1

Git newbie here. Using Xcode 4.3.2. Had to move my project file directory. Commit still works fine but when I do a git push, I get Everything up-to-date, which is incorrect.

How do I get back on track?

Thanks

Ty Kroll
  • 1,385
  • 12
  • 27

2 Answers2

2

Check also if you are not in a DETACHED HEAD mode.

That happens if you checkout a tag or a file (see git checkout illustration in gotgit):

git checkout

That was the case for the XCode question "Git (no branch) in xcode"

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • This is the case. I had to checkout from a prev commit and do a few things. I them checkout out the current head and began making changes. How can I push this back to Github now? Don't want to lose these changes. – Ty Kroll Apr 26 '12 at 08:07
  • @bubba_gump if your situation (after referencing those new commits by a branch) is similar to http://stackoverflow.com/a/2729765/6309, then yes you can push. If you push and GitHub complains about a non-linear history (asking you to 'git push --force', then don't. You might want to rebase your branch on `origin/master` (the remote GitHub branch) in order to push only linear history (that is, only new commits since last pull). Take also a look at http://stackoverflow.com/questions/5772192/git-how-can-i-reconcile-detached-head-with-master-origin – VonC Apr 26 '12 at 08:24
0

When you moved the project directory, did you move the .git folder with it? An easy way to check is to run git log and see if all of your previous commits are still there.

If you moved the .git folder with the rest of the files, then your remotes would still be setup correctly.

If it really isn't hooked up for some weird reason, try running git remote show origin and check to make sure that the url is correct and everything.

dontangg
  • 4,729
  • 1
  • 26
  • 38