Git for n00b
Command List
Command List
Command for each functionality
In the first part, we saw the list of resolved problem by Git. To resume Git should do:
- get others modifications,
- send modifications to others,
- get back in time,
- list differences between each version,
- name some versions in order to refer easily to them,
- write an historic of modifications,
- know who did what and when,
- manage conflicts,
- easily manage branches.
get others modifications
$ git pull
send modifications to others
$ git push
or more generally
$ git pull $ git push
get back in time
For all tree
$ git checkout
$ git revert
revert three version before (see my .gitconfig
file).
$ git uncommit 3
Undo the las merge (if something goes wrong)
$ git revertbeforemerge
For one file
$ git checkout file $ git checkout VersionHash file $ git checkout HEAD~3 file
list differences between each version
list files being modified
$ git status
differences between last version files and local files
$ git diff
differences between some version and local files
$ git diff VersionHash fichier
name some version to refer to them in the future
$ git tag 'toto'
show historic of modifications
$ git log $ git lg $ git logfull
know who did what and when
$ git blame fichier
handle conflicts
$ git conflict
manage branches
To create a branch:
$ git branch branch_name
To change the current branch:
$ git checkout branch_name
comments
Created: 11/12/2009
Modified: 05/09/2010