将提交从git存储库添加到GitHub

将提交从git存储库添加到GitHub,git,github,Git,Github,我更改了本地存储库中的一个文件,并在git中添加了更改和保存提交 现在我想发送这些更改并提交到GitHub中的project 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 els

我更改了本地存储库中的一个文件,并在git中添加了更改和保存提交

现在我想发送这些更改并提交到GitHub中的project

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添加。 //提交所有更改 git提交-m“消息” //确保您拥有最新的代码,以防其他人已提交更改 git拉原点 //使用最新代码更新github存储库 git推送原点

作为第一个命令类型

git add *
然后,编写一条提交消息,如下所示:

git commit -m 'here the message'
最后,将本地存储库的提交推送到在线存储库上:

git push origin master

这最后一个命令可能是您唯一需要的命令。如果出现错误,您需要键入命令:
git pull
然后
git push

您的解释很清楚,但我建议删除与问题相关的不太清楚的图像!!;-)我发现对一些人来说,用图像来理解它要容易得多。但是谢谢你的评论