git log --oneline
[wiki.git] / git.mdwn
1 [[!toc levels=3]]
2
3 ## Howto
4
5 ### How to tell which files git is tracking
6
7     git ls-files
8
9 ### How to get the short sha1 for a commit
10
11     git log --oneline
12
13 See also http://stackoverflow.com/questions/2405305/git-how-to-tell-if-a-file-is-git-tracked-by-shell-exit-code
14
15 ### Fix your email address in your commits
16
17 https://help.github.com/articles/changing-author-info
18
19 http://stackoverflow.com/questions/750172/how-do-i-change-the-author-of-a-commit-in-git
20
21 http://git-scm.com/docs/git-rebase#_recovering_from_upstream_rebase
22
23 http://serverfault.com/questions/12373/how-do-i-edit-gits-history-to-correct-an-incorrect-email-address-name
24
25 ### Use git submodules
26
27 Once your submodules are all set...
28
29     git submodule init
30     git submodule update
31
32 http://chrisjean.com/2009/04/20/git-submodules-adding-using-removing-and-updating/
33
34
35 #### Remove a git submodule
36
37 > To remove a submodule you need to:
38
39 > 1. Delete the relevant line from the ''.gitmodules'' file.
40 > 1. Delete the relevant section from ''.git/config''.
41 > 1. Run ''git rm --cached path_to_submodule'' (no trailing slash).
42 > 1. Commit the superproject.
43 > 1. Delete the now untracked submodule files.
44
45 > -- https://git.wiki.kernel.org/index.php/GitSubmoduleTutorial