在 master 分支中进行任何提交并使用它后git status
,它告诉我 origin 领先于 master 并且需要推送。
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
但是当在分支中提交并git status
在签出分支时使用时,它并没有区分原点和分支之间的区别。
On branch test-01
nothing to commit, working directory clean
test-01
我使用创建分支git checkout -b test-01
,并将其推送为git push origin test-01
,它有几个提交。
有时我会忘记我在分支中所做的提交,所以我没有推送它们。有没有一种方法可以像 master 分支一样跟踪本地和远程 repo 之间的区别?