3

I have an empty repository created and initialized it awhile ago. I've been trying to make commits and push them but weird things are happening.

1) I'll do 'git status' in the folder I want and see all the untracked files. Then, I'll do 'git add [file]'. Then, again, I will do 'git status' but the file I just added does not show up at all - not in new files, tracked files, or untracked files - it's just gone.

2) When I try to do 'git push origin master', I get the message

fatal: "https://github.com/*****/******.git/info/refs not found: did you run git update-server-info on the server?" 

What is going on???

2 Answers 2

4

Your repository is corrupted; it sounds like the refs folder has been deleted by accident. Fortunately, if you haven't made any commits, then you haven't really lost anything; just delete .git, then git init again, and you should be able to commit.

Also, note that if this is a GitHub repo, and you've changed your GitHub id between the time you created the repo and the time you tried to push, that's another reason for seeing the refs-not-found error.

Sign up to request clarification or add additional context in comments.

1 Comment

So I used this: "find . -type f | grep -i .git | xargs rm" and now I can see all files I'm tracking and not tracking. However, I tried to push again after initializing, adding files, committing, and I got this error: "error: failed to push some refs to 'github.com******/*****.git'".
1

Alright so more errors kept coming up, but I figured out a way to solve it...

After deleting the repository on my git page, I readded it, then initialized the repository, did

git remote add origin3 https://github.com/[user]/[repo].git 

and then did a

git pull origin3 master 

(I'm guessing that had retrieved previous commits I made?). I tried to do

git push origin3 master 

but I got a fatal 403 (HTTP request) error so I did this little diddy:

git remote set-url origin ssh://[email protected]/[user]/[repo].git 

then

git push origin master 

and I was golden.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.