----- isHidden: false menupriority: 30 kind: article created_at: 2009-11-12T11:39:54+02:00 title: Git for n00b author_name: Yann Esposito author_uri: yannesposito.com subtitle: Command List tags: - git ----- # Command List ## Command for each functionality In the first part, we saw the list of resolved problem by [Git][git]. To resume [Git][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
[git]: http://git-scm.org "Git"