I’m very new to git. I wanted to create a repository named Common-Lib, below is the commands I used.
E:\My Doc\programming\git\Common-Lib>touch README
E:\My Doc\programming\git\Common-Lib>git init
Initialized empty Git repository in E:/My Doc/programming/git/Common-Lib/.git/
E:\My Doc\programming\git\Common-Lib>git add README
E:\My Doc\programming\git\Common-Lib>git commit -m "first commit"
[master (root-commit) 5e25a0d] first commit
0 files changed
create mode 100644 README
E:\My Doc\programming\git\Common-Lib> git remote add origin https://github.com/fxbird/Common-Lib.git
E:\My Doc\programming\git\Common-Lib>git push -u origin master
fatal: https://github.com/fxbird/Common-Lib.git/info/refs not found: did you run git update-server-info on the server?
E:\My Doc\programming\git\Common-Lib>git update-server-info
E:\My Doc\programming\git\Common-Lib>git push -u origin master
fatal: https://github.com/fxbird/Common-Lib.git/info/refs not found: did you run git update-server-info on the server?
E:\My Doc\programming\git\Common-Lib>
Even after running git update-server-info, it still throws the same error, why is that? thanks.
The commands you’ve used have successfully created a repository OK on your own machine, but it doesn’t exist on Github; that’s why you get the error:
The “refs” file isn’t found because it doesn’t exist. Your best solution is to create the repository on Github first and then clone it to your local machine. That way everything will be set up for you to push and pull.
Oh, and when you ran:
you ran that on your local repository, not on the server so it wouldn’t work anyway. That command generates files necessary to access your repository over “dumb” protocols like http.