笔者因为是写了两份(一份没changed,一份changed后的),本来想在master和change分支都push同一份,然后写个readme搞一下完事的,但在push完master,转到change分支后,在commit时,出现
On branch change nothing to commit, working tree clean
上网查询后是没有修改过文件的意思
于是我就先把本来changed要提交的东西挪出了我的总文件夹,更新一下,结果在切换分支的时候又提示我:
error: The following untracked working tree files would be overwritten by checkout
于是我git clean -d -fx(删除没有add的文件)
然后我决定屈服,将我的文件手动分成了change前和change后的,在master提交完change前的,在修改我的代码,替换成change后的,再转到change分支进行提交,然后我又遇到了一个问题
The current branch master has no upstream branch. To push the current branch and set the remote as upstream
这个错误的意思是本地分支与远程分支之间没有连接起来
所以解决办法是:git push -u origin change
这样就可以顺利提交了
实验三在git上操作遇到的一些问题
最新推荐文章于 2021-08-13 00:58:01 发布