git - JasonWayne/personal-wiki GitHub Wiki
官方教程Try Git,非常非常好,强烈推荐。用一段时间Git后再过一遍教程,仍然受益匪浅,记得看右下角的advice。推荐从CodeSchool中进入。 http://www.bootcss.com/p/git-guide/
参考http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/00137583770360579bc4b458f044ce7afed3df579123eca000和http://www.it165.net/os/html/201402/7303.html
主要流程参考前一篇,后一篇主要参考了如何生成id_rsa.pub
文件。如果不添加该文件,每次操作都需要输入密码,非常麻烦,这里与配置Hadoop非常相似。
git reset HEAD 如果遇到Unstaged changes after reset: 可以 git stash git stash drop
# https://stackoverflow.com/questions/927358/how-to-undo-the-most-recent-commits-in-git
# if local
git log
commit 101: bad commit # latest commit, this would be called 'HEAD'
commit 100: good commit # second to last commit, this is the one we want
git reset --soft HEAD^ # use --soft if you want to keep your changes
git reset --hard HEAD^ # use --hard if you don't care about keeping the cha
git rebase -i 6d38262456eedf0c1919da6df4303280fcb5463c^
git merge --abort
git checkout -- path_of_file
git branch -m <oldname> <newname>
# if rename current branch
git branch -m <newname>