warning: push.default is unset; its implicit value is changing inGit 2.0 from ‘matching‘ to ‘simple

'matching'参数是 git 1.x 的默认行为,其意是如果你执行 git push 但没有指定分支,它将 push 所有你本地的分支到远程仓库中对应匹配的分支。

而 Git 2.x 默认的是 simple,意味着执行 git push 没有指定分支时,只有当前分支会被 push 到你使用 git pull 获取的代码。

解决办法是:

git config --global push.default matching

git查看当前分支的方法

查看远程分支:git branch -a

查看本地分支:git branch

创建分支:git branch test

把分支推送到远程分支:git push origin test

切换分支到test:git checkout test

猜你喜欢

转载自blog.csdn.net/whitephantom1/article/details/124777526
今日推荐