You are on page 1of 2

Git Installation and Setup

Install Git on your machine


Windows: http://help.github.com/win-git-installation
Linux: http://help.github.com/linux-git-installation
Mac: http://help.github.com/mac-git-installation
Generate SSH keys for accessing Reliable Git Repository:
Windows: http://help.github.com/msysgit-key-setup/
Linux: http://help.github.com/linux-key-setup/
Mac: http://help.github.com/mac-key-setup/
Setup SSH keys to avoid re-entry:
http://help.github.com/working-with-key-passphrases/

Commonly Used Commands


Clone HRP repo into your local from server:
git clone git@192.168.1.8:HRP.git

View local repo state:


git status

Add file changes to be commited:


git add <file path>
git add . (add all file changes to index to be commited)

Commit changes to local repo:


git commit m <your comment>
git commit a m <your comment> (commit all changes that havent been added to
index)

Pull from remote repo:


git pull

Push local repo to remote:


git push

To resolve conflict during commit to remote:


Conflict inside a file on different lines.
- After committing in your local repo, then you call git push. It will reject and say
there's conflict.
- call git pull and it will auto merge your conflict.
- call git push again. It will push successfully to server.
Conflict inside a file on same lines.
- After committing in your local repo, then you call git push. It will reject and say

there's conflict.
- call git pull and it will merge the conflicting content in diff style markers.
- call git mergetool and it will open the conflicting file(s) with the default merge
tool (e.g. vimdiff) in three-way diff view.
- merge the code between the local commit and the remote code, and save.
- clean the .orig file created by the merge tool by calling: git clean -f
- run git commit
- run git push
Change merge tool used by git:
git config --global merge.tool "araxis"

Include the the directory of the merge tool in the PATH

You might also like