linux - 关于 git 提交到 github我怎么老是 push不上去呀
黄舟
黄舟 2017-04-17 16:14:43
0
11
1156

教教我

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(11)
刘奇

In addition to the method above + Baidu should be able to solve it

阿神
origin 是关键字吧 ,最好不要设置远程为origin 你可以设置为upstream 看看~~
Peter_Zhu

You try it ssh -T git@github.com 看看有没有权限
另外 git commit 一般都写成 git commit -m "first commit"

Peter_Zhu

As mentioned above, you did not use -m to specify the commit message when committing, causing the commit to fail.

伊谢尔伦

Doesn’t the remote branch already exist? First set-upstream, then pull and push

巴扎黑

When you executed git commit test.txt, it failed (note that there are three words "stopped" at the bottom). The reason is that git forces the commit operation to have comments (svn is not mandatory), and you did not add comments. You have to execute "git commit -m "Write a comment here, it can be in Chinese"" before you can submit normally. Then "git remote add origin git@github.com/xxxx/xxx.git". Finally "git push origin master" will do the trick.

PHPzhong

Usually use commit -m "modify version information", and then use git add remote origin + information.

左手右手慢动作

There is nothing in the local library
`git status
git add .
git commit -m "update" `
Then push.

左手右手慢动作

Transfer your public key to github first

小葫芦

First, pay attention to the running results of the command. After the previous command runs successfully, run the following command again. The author started to get errors from the third git command, git commit都没有成功,后续的push命令当然也会报错。另外,由于楼主的仓库貌似默认已经有远程仓库(origin)了,因此再通过git remote add origin ...设置远程仓库当然会产生冲突。你可以换一个远程仓库的别名,例如楼上说的upstream,或者你可以通过git remote set-url origin <your remote repository url> came to reset the origin URL.
It can be seen from your operation that you should be a beginner. It is recommended that you understand the basic commands of git first, and then come to the forum to ask questions when you encounter complex problems. By the way, the book Progit is a good choice for learning git. There is a free electronic version on the official website.
In addition, I think if you can use text explanation + code or error log when asking a question, try not to post pictures directly, as this will not be convenient for others to search online.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!