https://help.github.com/articles/generating-ssh-keys/
Good message
Short summary(title): <50c
A longer description of the changes follows: 72c
Git over LAN
git pull [email protected]:/Users/haivu/projects/shizzleSet config
$ git config --global core.editor subl -w -n
$ git config --global user.name "Vu Do"
$ git config --global user.email "[email protected]"
# add key to agent
ssh-add -K ~/.ssh/id_rsa
# use specific key
git config core.sshCommand 'ssh -i /Users/localadmin/.ssh/ci-id_rsa' Remove files from git
git rm --cached FILE_NAME
git add -u
git commit -m "removing files from version control"
git pushFetch
git fetch -p origin # fetch deleted branches
Rename
git mv README README.md
git commit -m "renamed"
git push origin masterUntrack files
git update-index --assume-unchanged [file]Export
git archive master | tar -x -C /Users/haivu/projects/abc # to a directory
git archive --format zip --output /full/path/to/zipfile.zip master # to a zip fileCherrypick
git cherry-pick A^..B # cherrypick multipleDetached head
git reflog
git log
git checkout master
git merge HEAD@{2}
Revert commit
git push origin +dd61ab32^:master # reset master to a commit
Undo commit
git reset --hard HEAD~1Orphan branch New branch with no history
# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH
# Add all the files:
git add -A
# Commit the changes:
git commit -am "Initial commit"
Submodule
git submodule init
git submodule update -f # force update
# remove
git submodule deinit <path_to_submodule>
git rm <path_to_submodule>
git commit -m "Removed submodule "
rm -rf .git/modules/<path_to_submodule>