我可以运行这些命令并获得预期的输出。
然而,这就是我的问题所在。
$ git branch --track test
$ git checkout test
$ touch hello.txt
$ git add hello.txt
$ git commit -m hello.txt
$ git status
On branch test
Your branch is ahead of 'master' by 1 commit.
然而,这就是我的问题所在。
$ git checkout master
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
我想知道自己是否领先于 origin/master
,但我也想知道自己是否落后于 test
。我想要一个命令来给我这样的结果:
On branch master
Your branch is up-to-date with 'origin/master'.
Your branch is behind 'test' by 1 commit, and can be fast-forwarded.