Note that there are some explanatory texts on larger screens.

plurals
  1. POgit local master branch stopped tracking remotes/origin/master, can't push
    primarykey
    data
    text
    <p>Just when I thought I'd got the hang of the <em>git checkout -b newbranch - commit/commit/commit - git checkout master - git merge newbranch - git rebase -i master - git push</em> workflow in git, something blew up, and I can't see any reason for it. </p> <p>Here's the general workflow, which has worked for me in the past:</p> <pre><code># make sure I'm up to date on master: $ git checkout master $ git pull # k, no conflicts # start my new feature $ git checkout -b FEATURE9 # master @ 2f93e34 Switched to a new branch 'FEATURE9' </code></pre> <p><em>... work, commit, work, commit, work, commit...</em></p> <pre><code>$ git commit -a $ git checkout master $ git merge FEATURE9 $ git rebase -i master # squash some of the FEATURE9 ugliness </code></pre> <p>Ok so far; now what I expect to see -- and normally do see -- is this:</p> <pre><code>$ git status # On branch master # Your branch is ahead of 'origin/master' by 1 commit. # nothing to commit (working directory clean) </code></pre> <p>But instead, I only see "<strong>nothing to commit (working directory clean)</strong>", no "<strong>Your branch is ahead of 'origin/master' by 1 commit.</strong>", and git pull shows this weirdness:</p> <pre><code>$ git pull From . # unexpected * branch master -&gt; FETCH_HEAD # unexpected Already up-to-date. # expected </code></pre> <p>And git branch -a -v shows this:</p> <pre><code>$ git branch -a -v FEATURE9 3eaf059 started feature 9 * master 3eaf059 started feature 9 remotes/origin/HEAD -&gt; origin/master remotes/origin/master 2f93e34 some boring previous commit # should=3eaf059 </code></pre> <p>git branch clearly shows that I'm currently on * master, and git log clearly shows that master (local) is at 3eaf059, while remotes/origin/HEAD -> remotes/origin/master is stuck back at the fork.</p> <p>Ideally I'd like to know the semantics of how I might have gotten into this, but I would settle for a way to get my working copy tracking the remote master again &amp; get the two back in sync without losing history. Thanks!</p> <p>(<em>Note: I re-cloned the repo in a new directory and manually re-applied the changes, and everything worked fine, but I don't want that to be the standard workaround.</em>)</p> <p><strong>Addendum</strong>: The title says "can't push", but there's no error message. I just get the "already up to date" response even though <em>git branch -a -v</em> shows that local master is ahead of /remotes/origin/master. Here's the output from <em>git pull</em> and <em>git remote -v</em>, respectively:</p> <pre><code>$ git pull From . * branch master -&gt; FETCH_HEAD Already up-to-date. $ git remote -v origin git@git.company.com:proj.git (fetch) origin git@git.company.com:proj.git (push) </code></pre> <p><strong>Addendum 2</strong>: It looks as if my local master is configured to <em>push</em> to the remote, but not to pull from it. After doing <code>for remote in 'git branch -r | grep -v master '; do git checkout --track $remote ; done</code>, here's what I have. It seems I just need to get master <em>pulling</em> from remotes/origin/master again, no?</p> <pre><code>$ git remote show origin * remote origin Fetch URL: git@git.company.com:proj.git Push URL: git@git.company.com:proj.git HEAD branch: master Remote branches: experiment_f tracked master tracked Local branches configured for 'git pull': experiment_f merges with remote experiment_f Local refs configured for 'git push': experiment_f pushes to experiment_f (up to date) master pushes to master (local out of date) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload