Git

From HaFrWiki
Revision as of 13:33, 24 April 2013 by Hjmf (talk | contribs) (Created page with "{{TOCright}} == Cheat Sheet == Always handy are Cheat Sheets <ref>[http://rogerdudler.github.io/git-guide/files/git_cheat_sheet.pdf Roger Dudler], Sheet Cheat</ref>. {| class...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Cheat Sheet

Always handy are Cheat Sheets [1].

Create & Clone Add & Remove
Create new repo git init Add changes to INDEX git add <filename>
Clone local repo git clone /path Add all changes to INDEX git add *
Clone remote repo git clone username@host:/path/to/repo Remove / Delete git rm <filename>


Commit & Synchronize Branches
Commit changes git commit -m "Message" Create new branch git checkout -b <branch>
i.e.: git checkout feature-x
Push changes to remote repo git push origin master Switch to master branch git checkout master
Connect local repo to remote repo git remote add origin <server> Delete branch git branch -d <branch>
Update local repo with remote changes git pull push branch to remote repo git push origin <branch>


Merge Tagging
Merge changes from another branch git merge <branch> Create tag git tag <tag> <commit-ID>
View changes between 2 branches git diff <src-branch> <trg-branch> Get commit IDs git log


See also

top

Reference

top

  1. Roger Dudler, Sheet Cheat