scratch/content/html/en/blog/2009-11-12-Git-for-n00b/commandes-avancees.md
Yann Esposito (Yogsototh) c27ef7e205 new version working (almost)
2010-04-15 11:45:50 +02:00

2.4 KiB

isHidden menupriority kind created_at title multiTitle tags
false 30 article 2009-11-12T11:39:54+02:00 The Adventure Begins
fr en
Liste de commandes 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

fr:différences entre les fichier de la dernière version et les fichiers locaux.

$ git diff

liste les différences entre les fichier d'une certaine version et les fichiers locaux.

$ 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

en: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