I have 2 GitHub repos, let's call them GH1 and GH2, and 2 corresponding local repos, let's call them LR1 and LR2 that have them as remotes. For clarity, here is the local repo to remote repo mapping:
LR1 ---> GH1
LR2 ---> GH2
I manually upload (and commit) the same file, let's call it A.jpg, to both GitHub repos using the GitHub web UI. I get different results when I try to merge from the remotes back down to my local repos.
I use git on the command line for the purposes of this problem.
One of local repos (LR1) behaves as I would expect:
git fetch
gets the change from the remote but doesn't merge it.
git merge
merges A.jpg and fast-forwards the local repo.
git status
shows that there is "nothing to commit, working directory clean"
The other one (LR2) behaves differently than I would expect:
git fetch
gets the change from the remote but doesn't merge it.
git merge
merges A.jpg and fast-forwards the local repo.
git status
shows that A.jpg is modified and is an uncommitted change.
git pull
behaves the same way, with respect to the 2 local repos, but for the purposes of breaking this problem down, I thought I would explicitly call out the 2 commands (git fetch
and git merge
) that do the same thing as a pull.
I assume that I have the 2 local git repos configured differently and that is causing the issue. What would cause this behaviour?