简体   繁体   中英

git push -u origin master no answer

I'm tryint to push two files from my local machine to gihub just for testing, I have an empty repository called test on github, and a local repository test on my machine. But gets no answer after git push -u origin master here's what i did in the command window:

C:\Users\TJIA\Documents\GitHub\test [master]> git remote add origin https://gith
ub.com/Svampyr/test.git
fatal: remote origin already exists.
C:\Users\TJIA\Documents\GitHub\test [master]> git remote rm origin
C:\Users\TJIA\Documents\GitHub\test [master]> git remote add origin https://gith
ub.com/Svampyr/test.git
C:\Users\TJIA\Documents\GitHub\test [master]> git push -u origin master

I'm new to github, anyone can correct me, thanks!

Create a new local folder and try to do this: Does this work for you? You can add your files to this new folder and try with them;)

touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/Svampyr/test.git
git push -u origin master

Maybe there is no commit in your repository? If you don't know, type "git log" and check if there is one or not.

To see what is happening, try running:

GIT_TRACE=2 git push -u origin master

Also have you tried pushing to the SSH url instead of the https url?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM