0

What do I have to do to get around this "already up-to-date" error:

I created a new local repo and tried to pull the remote master branch. It stumbled over my new .gitignore and errored out. I deleted the .gitignore (to be replaced with the repo's), but now I can't pull that branch.

User@BRD-09-DEC10 /c/path/to/local (master)
$ git pull stage master
user@website.com password:
remote: Counting objects: 1211, done.
remote: Compressing objects: 100% (1191/1191), done.
remote: Total 1211 (delta 81), reused 0 (delta 0)
Receiving objects: 100% (1211/1211), 83.05 MiB | 491 KiB/s, done.
Resolving deltas: 100% (81/81), done.
From ssh://website.com/path/to/repo
 * branch            master     -> FETCH_HEAD
error: Untracked working tree file '.gitignore' would be overwritten by merge.

User@BRD-09-DEC10 /c/path/to/local (master)
$ ls -al
total 5
drwxr-xr-x    4 User Administ        0 Jan  9 11:35 .
drwxr-xr-x   17 User Administ     4096 Jan  9 11:32 ..
drwxr-xr-x    7 User Administ     4096 Jan  9 11:38 .git
-rw-r--r--    1 User Administ       19 Jan  9 11:35 .gitignore
drwxr-xr-x    3 User Administ        0 Jan  9 11:35 nbproject

User@BRD-09-DEC10 /c/path/to/local (master)
$ rm .gitignore

User@BRD-09-DEC10 /c/path/to/local (master)
$ git merge stage/master
fatal: 'stage/master' does not point to a commit

User@BRD-09-DEC10 /c/path/to/local (master)
$ git pull stage master
user@website.com's password:
From ssh://website.com/path/to/repo
 * branch            master     -> FETCH_HEAD
Already up-to-date.

I was hoping that I get this because the remote branch is already stored locally (it took a while to git the first time), but if that's the case, then I guess I don't know how to merge that branch.

This happens periodically - any idea why?

kenorb
  • 155,785
  • 88
  • 678
  • 743
doub1ejack
  • 10,627
  • 20
  • 66
  • 125

1 Answers1

1

The pull seems to be successfull. Check with

git status

If this is the case

git checkout -- .gitignore 

should bring the file back (the version from remote repository

murraybo
  • 895
  • 8
  • 13
  • At no point were any files available in `/c/path/to/local`. This makes me think that the pull was not successful, no? – doub1ejack Jan 09 '13 at 17:18
  • What is the output of git status? – murraybo Jan 09 '13 at 17:19
  • `#on branch master` `nothing to commit` ..which may be odd because at that point I was on a brand new repo and had not yet made a commit – doub1ejack Jan 09 '13 at 20:51
  • Do the output of `git log` (in your local branch) and `git log stage/master` differ? Is there any file still missing in your working copy? – murraybo Jan 10 '13 at 08:54