GIT.md 775 Bytes
Newer Older
Arnaud Blanchard's avatar
Arnaud Blanchard committed
1

Arnaud Blanchard's avatar
Arnaud Blanchard committed
2 3
Useful commands for git
=======================
Arnaud Blanchard's avatar
Arnaud Blanchard committed
4 5 6 7 8 9 10 11 12 13 14

Merge
=====

`git merge <the branch you merge from>`

Note that git pull merge from he repository branch

Conflicts:
----------

15
You can use **meld** to have a graphical interface to select the differences. 
Arnaud Blanchard's avatar
Arnaud Blanchard committed
16

17 18
- You want to get only their modifications: `git checkout  --theirs <files>` 
- You want to get only yours modifications: ` git checkout  --ours <files>`
Arnaud Blanchard's avatar
Arnaud Blanchard committed
19 20 21 22

Then `git add <files>`to say you fix the conflict.

Remove a specific commits: `git revert <commit id>`
23

24 25 26 27 28 29
Revert
======

All the project `git revert <commit>`

A specific file: `git checkout <commit> -- <paht/to/file>`
30 31 32 33

Submodule
=========

34 35 36
Remove
------

37 38 39
    git submodule deinit -f -- <submodule>
    rm -rf .git/modules/<submodule>
    git rm -f <submodule>
40