5

I have a repository with a number of branches. All the branches are up to date with the equivalent remote branch.

For example see the output from git status and git log for the following two branches:

Branch mantis_0074

mchaleg@ELT-L-0018 ~/Documents/BitBucket/electroroute_repositories/gudrun (mantis_0074)
$ git status
On branch mantis_0074
nothing to commit, working directory clean

mchaleg@ELT-L-0018 ~/Documents/BitBucket/electroroute_repositories/gudrun (mantis_0074)
$ git log --oneline --decorate
a67b6f7 (HEAD, origin/mantis_0074, mantis_0074) M-0074: Update expected results from sample bids.
afda69c M-0074: Rename long and short term intra-day BritNed auction files to use the correct name format so that they will be processed correctly (i.e. not handled as
bcc41 M-0074: Add unprocessed files which can be used for testing amp_file_transfer.ps1 script.

Branch mantis_0151

mchaleg@ELT-L-0018 ~/Documents/BitBucket/electroroute_repositories/gudrun (mantis_0151)
$ git status
On branch mantis_0151
Your branch is up-to-date with 'origin/mantis_0151'.

nothing to commit, working directory clean

mchaleg@ELT-L-0018 ~/Documents/BitBucket/electroroute_repositories/gudrun (mantis_0151)
$ git log --oneline --decorate
f0487e2 (HEAD, origin/mantis_0151, mantis_0151) mantis_0151 Finalised version of trigger with updated varaible names etc
24a0ae0 mantis_0151 get the tb_apx_fact_private_trades table trigger into line with what is in production as it currently isn't. Also add the create statement as well

You can see from the git log output that both branches are up to date with the remote branch.

Seeing as both branches are up to date why is the message Your branch is up-to-date with 'origin/branch' only displayed in the git status message of the branch mantis_0151?

gerard
  • 701
  • 8
  • 19

1 Answers1

6

Git will only show you this message if your branch is set up to track a remote branch. Your first branch doesn't appear to be.

meager
  • 209,754
  • 38
  • 307
  • 315
  • 2
    That did the trick. I was able to track the remote branch using `git branch -u origin/branch`. What I don't understand is why some of the branches are setup to track the remote and some are not. Until now I didn't know about tracking the remote branch so I haven't manually done this previously. – gerard Dec 08 '14 at 23:40
  • 1
    For details on how to track a remote branch see [Make an existing Git branch track a remote branch?](http://stackoverflow.com/questions/520650/make-an-existing-git-branch-track-a-remote-branch) – gerard Jan 15 '15 at 22:47