Git 资料

 

 

__________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 clonegit 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.

 

https://www.liaoxuefeng.com/discuss/001409195939432748a2c9fae3846bc98b3c2a547fa321b000/001443433776805e57345a4967740a1a6adada3cbf6af2c000

discussion

_________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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值