问题描述
我刚开始使用Git,所以也许我在做一些基本的错误.我想做的是将分支的提交推送到Github上的远程仓库中.我尝试了以下行
I'm pretty new to using Git, so maybe I'm doing something basic wrong. What I'm trying to do is push the commits of a branch to the remote repo on Github. I tried the following line
git push origin Interface
它返回一切都是最新的",但是当我检查Github上的分支时,我的更改不存在.我在做什么错了?
It returns 'Everything up-to-date', but when I check the branch on Github, my changes aren't there. What am I doing wrong?
推荐答案
在进行推送之前,请确保已将文件添加到索引并且已提交更改.提交消息是一个好习惯.如果您未提交消息,请使用git log
查找SHA来进行最近的提交.在Git-hub上,检查SHA或消息中是否有最新提交.
Before you push make sure that files are added to the index and changes have been committed. Its a good practice to commit with a message. In case you did not commit with message, use git log
to find SHA for most recent commit. On the Git-hub check the SHA or message for most recent commit.
在执行git push <remote> <local_branch>:<remote_branch>
时,请确保要上传更改以更正远程和分支.
While doing git push <remote> <local_branch>:<remote_branch>
make sure that you are uploading changes to correct remote and branch.
在Git-hub上,验证您是否在正确的分支和修订版上.
On the Git-hub verify that you are on the correct branch and revision.
这篇关于推送后,git会说一切都是最新的,但更改不在仓库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!