4

I'm working off of an existing project that I have been committing and pushing to git. For a couple reasons, I had to change rails versions from 4.0 to 3.2.6 and use existing project files from a tutorial by downloading the files and replacing my local app folder with them.

Now I can't push to my existing repo on git that I have been working on.

If I try to commit, I get two errors:

error: pathspec 'origin' did not match any file(s) known to git. error: pathspec 'master' did not match any file(s) known to git.

I tried to delete the local app folder, clone the repo and then replace all of the files with the 3.2.6 version app that I have been working on but I still get the same commit errors.

Sajad
  • 153
  • 1
  • 2
  • 10
  • did you do some change to .git folder? try git branch , and check whether the master exist? can you do this and post what you get? – User123456 Jan 17 '14 at 04:26
  • you saying that you have cloned repo originally from the source and replaced the files manually and you still get the same problem? ok? – User123456 Jan 17 '14 at 04:30

2 Answers2

1

You can try to specify the full git push command:

git pull -u origin master

If it doesn't work, check if your remote declaration were altered in any way:

git remote -v

also, as show in this article, list references and branches:

git branch -avvv
git show-ref

check that you are in a branch, and not in a detached HEAD.

Make sure you don't have a branch named 'origin' (which would be confusing here)


As mentioned in this issue (for git svn, which isn't your case, but can still give interesting idea), trying to clone again the repo could lead to a non-corrupted .git folder, and the ability to push again.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

Did you checked your git config file placed in

.git/config

in your project folder? You can find the details of your repo & branches information in this file.

Hope it helps.

Onur Kucukkece
  • 1,708
  • 1
  • 20
  • 46