How do I get git to stop "lying" to me about being aware of the remote branch?

From my dev machine, I just pushed a few new comments to a origin/test

thread on my bitbucket account. Now I need to output this code to the deployment machine, so I checked out the branch test

, for example:

$ git checkout test

      

I was already on a test branch, so I got this message:

Already on 'test'

      

But I also got this message, which is (at first glance) very confusing:

Your branch is up-to-date with 'origin/test'.`

      

My thread is not really up to date with the version origin/test

that is on bitbucket. In the end, I just pushed new commits!

I understand that I am getting this message because my local copy is up to test

date with my local copy origin/test

, but I do not find this information useful in this context and it is very easy to misinterpret this message to keep in mind that my local copy test

matches date with the deleted copy origin/test

, even if it is not.

Can I just turn off this message "Your branch is up to date"? I'm never really interested in how I use this machine for deployment, so seeing it only gives you confusion and frustration.

+3


source to share


2 answers


I think you can often ask yourself git fetch

to sync yours origin/*

with the remote.

Edit:



Or you can create an alias to do fetch

before each checkout

:

git config --global alias.fco '!git fetch && git checkout'

      

+3


source


You can remove the tracking information for your branch, then the git status won't show anything about being up-to-date or ahead. You will have to manually specify refs for fetch and push.



0


source







All Articles