早上测试脚本的时候,偶然在这篇文章<Git – setting up a remote repository and doing an initial push>看到一个关于 git 的好玩东西,记录于此. 根据文章的提示在 ~/.bashrc 里添加下面的内容,可以让提示符显示当前 git 的分支名称.我按照自己的习惯修改了提示符的格式. __mikespook_ps1() { local none='\[\033[00m\]' local g='\[\033[0;32m\]' local
git: Your branch and 'origin/master' have diverged - how to throw away local commits? - Stack Overflowhttp://stackoverflow.com/questions/19864934/git-your-branch-and-origin-master-have-diverged-how-to-throw-away-local-com git: Your branch and 'origin
Git master branch has no upstream branch的解决 在push代码时,出现“git master branch has no upstream branch”问题的原因是没有将本地的分支与远程仓库的分支进行关联.如下图所示: 具体原因: 出现这种情况主要是由于远程仓库太多,且分支较多.在默认情况下,git push时一般会上传到origin下的master分支上,然而当repository和branch过多,而又没有设置关联时,git就会产生疑问,因为它无法判