Dies ist eine alte Version des Dokuments!
git help git help <command> cat .git/config
See Mercurial <=> Git Command comparison
| hg | git | comment |
|---|---|---|
| hg branches | git branch [-a] | |
| hg commit -m 'msg' | git commit -a -m 'msg' | from trial / alternative: git add …; git commit |
| hg glog | git log –graph | |
| hg glog -v | git log –name-only | |
| hg init | git init | from trial |
| hg pull -u | git pull [url] | URL may be specified, otherwise remot tracking thing is used? |
| hg push -r | git push | did not work without -r / To be investigated |
| hg status; hg outgoing | git status | |
| hg uptdate … | git checkout … |
Example: Using SSH from within the remote home dir
git clone ssh://[user@]host/~user/tmp/igit igitigit
See git help clone (also for valid URL formats)
git clone <url> without specifying a branch name is dependent on which branch the source repo currently is!
git branch shows existing local branches, while git branch -r causes the „remote-tracking“ branches to be listed, and option -a shows both. See git-branch
With Git it is not possible to directly swich to a different branch on a cloned repository like in Mercurial. Instead first you have to create a new (local) branch wich „tracks“ the specified remote brach, eg. (origin/stable) and then checkout (=update) this branch to your working directory. The following command does both steps at once:
git checkout -b stable origin/stable
Now you can pull all needed updates whenever a new release is made:
git pull