繁体   English   中英

将git仓库中的提交添加到GitHub

[英]Add commit from git repository to GitHub

我已经更改了本地存储库中的文件之一,并且添加了更改并将提交保存在git中。

现在,我想发送这些更改并提交到GitHub中的项目。

GitHub中的存储库存在,但现在我可以添加所有更改和提交。

我怎样才能做到这一点?

//  add all your files
git add .

// commit all your changes
git commit -m "message"

// Make sure you have the latest code in case someone else has committed changes
git pull origin <branch name>

// Update github repository with your latest code
git push origin <branch name>

在此处输入图片说明

作为第一命令类型;

git add *

然后,编写如下的提交消息:

git commit -m 'here the message'

最后,将本地存储库的提交推送到在线存储库中:

git push origin master

也许最后一条命令是您唯一需要的命令。 如果发生错误,则需要键入以下命令: git pull然后git push

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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