scratch/content/html/en/blog/2009-11-12-Git-for-n00b/commandes-avancees.md
Yann Esposito (Yogsototh) 592d005bf4 Some repairs
- link to multi
    - en: and fr: forgotten
2010-05-05 01:13:59 +02:00

2.3 KiB

isHidden menupriority kind created_at title subtitle tags
false 30 article 2009-11-12T11:39:54+02:00 Git for n00b Command List
git

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