__________2018.10.24_____________________
got 'fatal: branch 'master' does not exist' in git
https://stackoverflow.com/questions/46915350/got-fatal-branch-master-does-not-exist-in-git
You are doing this the hard way.
In the future, instead of:
mkdir repo
cd repo
git init
git remote add origin <url>
git fetch origin
git checkout master
you can simply run:
git clone <url> repo
since the six commands above are pretty much what git clone
does.
After the first three steps—creating a new, totally-empty repository—you have a repository that is in a peculiar state: it has no commits, so it has no branches. At the same time, it does have a current branch, which is master
.
In other words, the current branch is a branch that does not exist.
This state is unusual, but normal. If you run git checkout --orphan newbranch
, you put your Git repository into that same state:1 on a branch that does not exist. The branch gets created once there is a commit hash to store under the branch name.
Whenever you run git checkout <name>
and there is no branch named <name>
, Git checks to see if there is exactly one remote-tracking branch such as origin/<name>
. If so, Git creates a newbranch named <name>
that points to the same commit as origin/<name>
and that has origin/<name>
as its upstream.
Since this last step—git checkout master
when master
does not actually exist yet—is the final step of git clone
, git clone
will also create a new branch master
that tracks the remote-tracking branch origin/master
.
1Note that you retain the current index / staging-area content. This is true for the new empty repository as well, but since it's a new empty repository, the index / staging-area is also empty, and "retaining the empty set" does not feel much like retainment.
_________2018.10.21___________________
git branching model
https://nvie.com/posts/a-successful-git-branching-model/
____________2018.10.20_______________________
git: three way merge and recursive
http://blog.fedeoo.cn/2017/02/22/git-%E5%90%88%E5%B9%B6%E7%AD%96%E7%95%A5-%E4%B9%8B-recursive/
http://www.drdobbs.com/tools/three-way-merging-a-look-under-the-hood/240164902?pgno=1
http://blog.plasticscm.com/2011/09/merge-recursive-strategy.html
__________before 2018. 8____________
Tutorials:
1,http://www.runoob.com/linux/linux-vim.html
2, https://www.atlassian.com/git/tutorials/setting-up-a-repository
各种坑:
1, https://www.atlassian.com/git/tutorials/setting-up-a-repository
git config --global safecrlf = warn