先 checkout 到 feature 分支,然后提交内容,然后切换到 master 分支,为什么是提示
Your branch is ahead of 'origin/master' by 1 commit.
这个意思是本地的 master 分支领先远程 master 一个提交吗??可是我不是在 feature 分支提交的吗?要领先不也是 feature 分支领先吗?
![]() | 1 geelaw 2021-02-21 11:31:22 +08:00 via iPhone 看一下 git 的历史图不就知道了么 除了不小心提交到了主分支上,也可能是有人让远程分支倒流,然后本地也意识到了远程的倒流。 |
![]() | 2 zyfsuzy 2021-02-21 11:42:08 +08:00 感觉不大可能,一定是你提交错了 |
3 zxCoder OP @geelaw @zyfsuzy ``` $ git switch -c a Switched to a new branch 'a' $ git branch * a dev feature1 master $ touch a.txt $ git add a.txt $ git commit -m "add a.txt" [a fdaf3d8] add a.txt 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 a.txt $ git switch master Switched to branch 'master' Your branch is ahead of 'origin/master' by 1 commit. (use "git push" to publish your local commits) ``` 请问这样操作哪里出问题了呢 |