Download sources: git clone git://github.com/TrinityCore/TrinityCore.git Download sources in custom folder: git clone git://github.com/TrinityCore/TrinityCore.git Update sources for up-to-date version: git pull origin master Show all branches (local + remote): git branch -a Download sources from specific branch: git clone git://github.com/TrinityCore/TrinityCore.git git checkout -b origin/ Create new branch: git branch Show current branch: git branch Switch branch: git checkout Show modifications - usually used when you commit something to your repo: git status Create patch from modified sources: git diff > .patch Create patch from different branches: git diff master -p > .patch git diff master > .patch Create patch from different commits: git diff > .patch git diff 719ffeb414c97e09469b 52cd2cbd7eb62648ae13 > .patch Apply patch to sources: git apply < .patch Apply patch to sources with creating of new files: patch -p1 < .patch Revert applied patch: patch -p1 -R < .patch Add all modifications to sources: git add * Add single modifications to sources: git add Create commit: git commit -a -m "" Create commit with author: git commit --author="name " -m "" Show log changes: git log git log --format=oneline Revert all changes in source code: git reset --hard Remove all except original source files: git clean -f -x -d Switch to master branch: git checkout master Delete specific branch: git branch -D Download specific revision of sources (for example 10 revisions below): git clone git://github.com/TrinityCore/TrinityCore.git cd ./TrinityCore git checkout master git reset HEAD~10 Switch to specific revision 1. Find commit's hash for specific revision: git log --grep=Core/DBLayer 2. Find needed commit's hash. Like this one: ... commit 70a45be1594c43e09f7103c910f11a0476f88b52 ... 3. Revert to specific revision with creation of new branch "DBLayer": git checkout -b DBLayer 70a45be1594c43e09f7103c910f11a0476f88b52 Undo last push to your remote repository: git push -f origin HEAD^:master or git rebase -i origin/~1 git rebase --abort git push origin + vim -> delete everything and type: noop Get all commits from specific one like patch files: git format-patch --full-index 52499b03ea8c86ab536c2025c3629b8883f591f2 Get cherry-pick patch from remote repository: git log --reverse --pretty=tformat:'git cherry-pick %h # %s' | grep "\[patch" Merge remote branch to your repository: git clone git@github.com:/TrinityCore.git cd ./ git remote add -f -t master -m master upstream git merge upstream/master Download remote fork to local repository: git remote add upstream git://github.com//TrinityCore.git git fetch upstream git checkout -b upstream/ git pull upstream Credits goes to ru-mangos community, google and github help topics =)