In the Git source, there seems to be a infinite loop in Git's fmt-merge-msg function when the repo sits in a SMB share while being accessed from Mavericks. The only way I've been able to fix this is by doing doing a process that doesn't involve automatic merging.
git pull
is essentially a git fetch && git merge
all in one command. If you try and do a git fetch
into your current branch when there have been changes, you may run into an issue where the git fetch
fails.
The way that I've fixed this issue is to fetch the remote branch into a temporary local branch and them merge that temp branch into your working branch. See the following which details trying to fetch the latest changes from your origin/master
into your current working branch master
.
Fetch the latest changes from
origin master
into a local branch calledmaster_merge_tmp
.git fetch [<remote loc>] [<remote branch>]:[<local branch>]
allows you to fetch the latest changes without invokingfmt_merge_msg
automatically and you can target a different local destination branch:git fetch origin master:master_merge_tmp
Merge the
master_merge_tmp
branch intomaster
:git merge master_merge_tmp
Perform some cleanup by deleting the remote branch
mater_merge_tmp
:git branch -D master_merge_tmp
Alternatively you could create a helper function to automate the steps above. You can place this in your .bashrc
or .zshrc
:
# Workaround for fmt-merge-msg issue on Mavericks w/SMB repo
# gfm [<remote>] [<remote branch>]
function _git-fetch-merge() {
local remote="$1"
local branch="$2"
local tmp_branch="${2}_merge_tmp"
git fetch $remote $branch:$tmp_branch
git merge $tmp_branch
git branch -D $tmp_branch
}
alias gfm="_git-fetch-merge"
Now from the terminal you can do the following:
_git-fetch-merge origin master
Or you can use the alias:
gfm origin master
If you are working with a remote upstream branch:
gfm upstream master