2

While migrating to from bash to zsh, that changed my alias of gl from 'git log' to 'git pull'. I then ran that in my octopress blog, first on branch 'master' and then on branch 'source'

Big mistake. On Github, the origin/master branch is used for deploys, and the origin/source is your blogging source.

On the 'master' branch, I seemed to pull in all the latest commits for Octopress. I'm guessing that I don't need to be concerned with that, since I use the source branch for generation. (Right?)

Next, when doing the pull into my source branch:

  1. Aborted the merge commit, by hitting :cq in Vim.
  2. Then I noticed that I got everything that is in my _deploy directory added to the top level directory.

I considered removing the extra directories with git clean, but that seemed to want to delete files/directories that are ignored (use the dry-run option!).

So manually rm -rf the list of directories/files that showed as untracked in git status.

So my git status looks clean now. If I list the remotes, I get this:

$ git remote show origin
* remote origin
  Fetch URL: git@github.com:justin808/justin808.github.io.git
  Push  URL: git@github.com:justin808/justin808.github.io.git
  HEAD branch: master
  Remote branches:
    flattr tracked
    master tracked
    source tracked
  Local branch configured for 'git pull':
    source merges with remote master
  Local refs configured for 'git push':
    flattr pushes to flattr (up to date)
    master pushes to master (local out of date)
    source pushes to source (up to date)

Anything else I need to check for?

Any way that I can make this more idiot prof so I can't accidentally git a git pull in this setup?

UPDATE

  1. When I use magit, I see TONS of unpulled and unpushed commits
  2. My git config has this:
[core]
  repositoryformatversion = 0
  filemode = true
  bare = false
  logallrefupdates = true
  ignorecase = true
  precomposeunicode = false
[remote "octopress"]
  url = git://github.com/imathis/octopress.git
  fetch = +refs/heads/*:refs/remotes/octopress/*
[branch "source"]
  remote = origin
  merge = refs/heads/master
[remote "origin"]
  url = git@github.com:justin808/justin808.github.io.git
  fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
  remote = octopress
  merge = refs/heads/master

I'm guessing that the issue is that my source branch should not have

merge = refs/heads/master

Maybe that should be:

merge = refs/heads/source

Or maybe I should simply delete that line? Actually no, as then I don't get proper information in my zsh prompt on if the branch is behind github.

Community
  • 1
  • 1
justingordon
  • 12,553
  • 12
  • 72
  • 116

1 Answers1

0

If you need to change the upstream branch of "source", you can do a:

git branch --set-upstream-to source origin/source
# or
git branch -u source origin/source

(More in "how do I change the remote a git branch is tracking?")

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • @justingordon editing a config file is error prone: let `git config` do that for you: it is what this command is for. – VonC Sep 30 '13 at 17:26