title: Git origin is behind head
body: <p>I've two branches on a git repo of my dotfiles, <code>master</code> and <code>kimura</code> and a remote setup on GitLab.  If I checkout either branch and <code>git push</code> I'm told I'm up-to-date...</p>
  
  <pre><code>$ git checkout master
  Already on 'master'
  $ git push
  Everything up-to-date
  $ git checkout kimura
  Switched to branch 'kimura'
  $ git push
  Everything up-to-date
  </code></pre>
  
  <p>I've made changes on branch <code>kimura</code> and submitted and merged pull-requests to master then merged the <code>kimura</code> with master using...</p>
  
  <pre><code>$ git checkout kimura
  Switched to branch 'kimura'
  $ git merge origin/master
  Already up to date.
  </code></pre>
  
  <p>However I've powerline prompts (under ZSH) and both show that I've commits waiting to be pushed and when I look at the history it shows the <code>origin</code> for both branches are behind the <code>HEAD</code>...</p>
  
  <pre><code>*   ef61530 - (HEAD -&gt; kimura) Resolving conflict to merge master into kimura (2019-01-26) &lt;slackline&gt;
  |\  
  | * 1ece19c - (origin/master) Reinstated sourcing of virtualenvwrapper.sh on work host (2019-01-18) &lt;slackline&gt;
  | *   80efc48 - Merge branch 'kimura' into 'master' (2018-12-17) &lt;nshephard&gt;
  | |\  
  * | | f32a089 - tweaking virtualenvwrapper.sh path for new host (2019-01-24) &lt;slackline&gt;
  * | | d2ccb42 - Tweaking specifics for work machine. (2019-01-24) &lt;slackline&gt;
  * | | 13fc696 - Updates to a few files (2019-01-24) &lt;slackline&gt;
  * | | a453190 - Added gnupg to link section (2019-01-23) &lt;slackline&gt;
  * | | c7da4ac - Added todo task and display of warnings at end of setup (2019-01-23) &lt;slackline&gt;
  * | | 07f313b - Added gnupg (2019-01-23) &lt;slackline&gt;
  * | | 20cf7f8 - Copying sample code from James (2019-01-23) &lt;slackline&gt;
  * | | 4edf7b5 - updated path for /mnt/personal (2019-01-12) &lt;slackline&gt;
  * | | 0b61635 - adding work_laptop profile (2018-12-19) &lt;slackline&gt;
  * | | 71c7d3f - Adding config/.config/.pycodestyle (2018-12-18) &lt;slackline&gt;
  | |/  
  |/|   
  * | 8ac383a - (origin/kimura) Starting off yapf config (2018-12-17) &lt;slackline&gt;
  |/  
  *   3d6aac6 - Merge branch 'master' of gitlab.com:nshephard/dotfiles into kimura (2018-12-10) &lt;slackline&gt;
  </code></pre>
  
  <p>I'm unsure how to get the <code>origin</code> on either branch to align with <code>HEAD</code> and would appreciate any suggestions/pointers.</p>
  
  <p>EDIT : </p>
  
  <p>On @Tim Biegeleisen suggestion I've tried the following...</p>
  
  <pre><code>$ git fetch origin
  From gitlab.com:nshephard/dotfiles
   * branch            master     -&gt; FETCH_HEAD
  $ git checkout kimura
  Switched to branch 'kimura'
  $ git merge origin/master
  Already up to date.
  </code></pre>
  
  <p>I've then tried merging the <code>kimura</code> branch directly with <code>master</code>...</p>
  
  <pre><code>$ git checkout origin/master                                                                                                                                                                                                                                                                           
  error: Your local changes to the following files would be overwritten by checkout:                                                                                                                                                                                                                                              
      gnupg/.gnupg/random_seed                                                                                                                                                                                                                                                                                                
  Please commit your changes or stash them before you switch branches.                                                                                                                                                                                                                                                            
  Aborting                                                                                                                                                                                                                                                                                                                        
  $ git stash                                                                                                                                                                                                                                                                                            
  Saved working directory and index state WIP on kimura: 8464bcc Merge 
  </code></pre>
  
  <p>branch 'kimura' into 'master'                                                                                                                                                                                                                              </p>
  
  <pre><code>$ git checkout origin/master                                                                                                                                                                                                                                                                           
  Note: checking out 'origin/master'.                                                                                                                                                                                                                                                                                             
  
  You are in 'detached HEAD' state. You can look around, make experimental                                                                                                                                                                                                                                                        
  changes and commit them, and you can discard any commits you make in this                                                                                                                                                                                                                                                       
  state without impacting any branches by performing another checkout.                                                                                                                                                                                                                                                            
  
  If you want to create a new branch to retain commits you create, you may                                                                                                                                                                                                                                                        
  do so (now or later) by using -b with the checkout command again. 
  Example:                                                                                                                                                                                                                                                      
  
    git checkout -b &lt;new-branch-name&gt;                                                                                                                                                                                                                                                                                             
  
  HEAD is now at 1ece19c Reinstated sourcing of virtualenvwrapper.sh on work host
  </code></pre>
  
  <p>...and on branch <code>master</code> origin still isn't quite up-to-date with <code>HEAD</code> as I'm now in a detached state having gone back to <code>origin</code> and having commits that are not yet merged...</p>
  
  <pre><code>* 1ece19c - (HEAD, origin/master) Reinstated sourcing of virtualenvwrapper.sh on work host (Fri Jan 18 10:52:17 2019 +0000) &lt;Neil Shephard&gt;
  *   80efc48 - Merge branch 'kimura' into 'master' (Mon Dec 17 18:10:50 2018 +0000) &lt;nshephard&gt;
  |\
  | * 8ac383a - (origin/kimura) Starting off yapf config (Mon Dec 17 17:15:42 2018 +0000) &lt;slackline&gt;
  |/
  *   3d6aac6 - Merge branch 'master' of gitlab.com:nshephard/dotfiles into kimura (Mon Dec 10 10:41:47 2018 +0000) &lt;slackline&gt;
  |\
  | *   2e0a40e - Resolving conflicts in zsh/.zshrc (Mon Dec 10 10:35:45 2018 +0000) &lt;Neil Shephard&gt;
  | |\
  | | *   1b0a018 - Merge branch 'kimura' into 'master' (Thu Dec 6 10:22:25 2018 +0000) &lt;nshephard&gt;
  | | |\
  | * | | a6f3350 - Removing line that calls virtualenvwrapper on work computer (Mon Dec 10 10:32:47 2018 +0000) &lt;Neil Shephard&gt;
  | |/ /
  | * | fefb0b0 - Commenting out $PATH (Mon Dec 3 13:38:33 2018 +0000) &lt;Neil Shephard&gt;
  | * |   2597385 - Merge branch 'kimura' into 'master' (Wed Nov 14 09:57:56 2018 +0000) &lt;nshephard&gt;
  | |\ \
  * | | | 69d1599 - Added port forwarding for mongodb to ds1 config (Fri Dec 7 10:33:52 2018 +0000) &lt;slackline&gt;
  | |_|/
  |/| |
  </code></pre>
  
  <p>...and am stumped again as to how to merge everything and bring <code>origin</code> to be inline with <code>HEAD</code>.</p>
  
  <p>EDIT 2 : </p>
  
  <p>As requested by @torek ...</p>
  
  <pre><code>$ git rev-parse --abbrev-ref master@{upstream}
  fatal: upstream branch 'refs/heads/master' not stored as a remote-tracking branch
  </code></pre>
  
  <p>My git config looks like...</p>
  
  <pre><code>user.email=xxxxx@gmail.com
  user.name=slackline
  push.default=simple
  credential.helper=cache
  pack.window=0
  pack.windowmemory=100m
  pack.packsizelimit=100m
  pack.threads=1
  color.ui=auto
  core.repositoryformatversion=0
  core.filemode=true
  core.bare=false
  core.logallrefupdates=true
  remote.origin.url=git@gitlab.com:nshephard/dotfiles.git
  remote.origin.pushurl=git@gitlab.com:nshephard/dotfiles.git
  remote.origin.push=+refs/heads/*:refs/heads/*
  branch.master.remote=origin
  branch.master.merge=refs/heads/master
  branch.master.pushremote=origin
  submodule.tmux/.tmux/plugins/tpm.url=https://github.com/tmux-plugins/tpm
  submodule.tmux/.tmux/plugins/tpm.active=true
  submodule.oh-my-zsh/.oh-my-zsh.url=https://github.com/robbyrussell/oh-my-zsh
  submodule.oh-my-zsh/.oh-my-zsh.active=true
  submodule.emacs/emacs.url=git@gitlab.com:nshephard/emacs.git
  submodule.emacs/emacs.active=true
  submodule.emacs/.emacs.d.url=git@gitlab.com:nshephard/emacs.git
  submodule.emacs/.emacs.d.active=true
  submodule.fonts.url=https://github.com/powerline/fonts
  submodule.fonts.active=true
  branch.kimura.remote=origin
  branch.kimura.merge=refs/heads/kimura
  branch.kimura.fetch=+refs/heads/*:refs/heads/*
  </code></pre>
  
  <p>Current log/graph looks like...</p>
  
  <pre><code>*   564630f - (HEAD -&gt; kimura, master) Merge branch 'kimura' into 'master' (Mon Jan 28 16:01:30 2019 +0000) &lt;nshephard&gt;
  |\  
  | * c6c75ba - Updating to use RSA keys as seahorse doesn't like ed25519 keys (Mon Jan 28 16:00:35 2019 +0000) &lt;slackline&gt;
  |/  
  *   8464bcc - Merge branch 'kimura' into 'master' (Sat Jan 26 09:32:05 2019 +0000) &lt;nshephard&gt;
  |\  
  | *   ef61530 - Resolving conflict to merge master into kimura (Sat Jan 26 09:30:54 2019 +0000) &lt;slackline&gt;
  | |\  
  | | * 1ece19c - (origin/master) Reinstated sourcing of virtualenvwrapper.sh on work host (Fri Jan 18 10:52:17 2019 +0000) &lt;Neil Shephard&gt;
  | | *   80efc48 - Merge branch 'kimura' into 'master' (Mon Dec 17 18:10:50 2018 +0000) &lt;nshephard&gt;
  | | |\  
  * | | \   6138abc - Merge branch 'kimura' into 'master' (Thu Jan 24 11:39:35 2019 +0000) &lt;nshephard&gt;
  |\ \ \ \  
  | |/ / /  
  | * | | f32a089 - tweaking virtualenvwrapper.sh path for new host (Thu Jan 24 11:39:04 2019 +0000) &lt;slackline&gt;
  | * | | d2ccb42 - Tweaking specifics for work machine. (Thu Jan 24 11:37:48 2019 +0000) &lt;slackline&gt;
  | * | | 13fc696 - Updates to a few files (Thu Jan 24 07:09:41 2019 +0000) &lt;slackline&gt;
  | * | | a453190 - Added gnupg to link section (Wed Jan 23 13:08:29 2019 +0000) &lt;slackline&gt;
  | * | | c7da4ac - Added todo task and display of warnings at end of setup (Wed Jan 23 11:01:08 2019 +0000) &lt;slackline&gt;
  | * | | 07f313b - Added gnupg (Wed Jan 23 10:58:22 2019 +0000) &lt;slackline&gt;
  | * | | 20cf7f8 - Copying sample code from James Ridgway https://github.com/jamesridgway/dotfiles/blob/master/setup (Wed Jan 23 10:57:32 2019 +0000) &lt;slackline&gt;
  | * | | 4edf7b5 - updated path for /mnt/personal (Sat Jan 12 07:55:45 2019 +0000) &lt;slackline&gt;
  | * | | 0b61635 - adding work_laptop profile (Wed Dec 19 12:34:16 2018 +0000) &lt;slackline&gt;
  | * | | 71c7d3f - Adding config/.config/.pycodestyle (Tue Dec 18 16:32:52 2018 +0000) &lt;slackline&gt;
  | | |/  
  | |/|   
  | * | 8ac383a - (origin/kimura) Starting off yapf config (Mon Dec 17 17:15:42 2018 +0000) &lt;slackline&gt;
  | |/  
  | *   3d6aac6 - Merge branch 'master' of gitlab.com:nshephard/dotfiles into kimura (Mon Dec 10 10:41:47 2018 +0000) &lt;slackline&gt;
  </code></pre>