更新远程存储库 git

Update remote repository git

我正在尝试将我的代码推送到 gitlab 现有存储库 几天前我已经推送了它并且我已经修改了我本地存储库中的一些文件夹和文件并且当我提交并将我的代码推送到我的远程仓库时它显示 提交后 -> 没有更改添加到提交 推送后 -> 一切都是最新的

当我查看远程仓库时,没有任何更新,它在那里显示我的旧代码.. 我认为这是因为我用一些文件夹和文件更新了我的本地存储库 这里有人知道可能是什么问题吗?

也许您需要删除 git cache。然后拉remote/master。然后 add/commit 您的本地更改。现在推送到远程。尝试以下命令。

$ git rm --cached -r .

$ git commit -am 'message'     # add & commit your local changes
$ git pull origin master       # sync with remote/master
$ git push origin master       # push local/master changes to remote

I tried as per alert in git bash that git commmit -a -m "mymessage" then only the existing files got updated , not the new folder and files ..how can I update the new remaining folder??

根据这条评论,我相信您 运行 git 提交不正确... git commit -a 没有提交未跟踪的文件。如果您要创建新文件,则需要使用 git add <file>

显式添加它们

来自提交帮助页面:

-a, --all Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected.

所以我想在现有的远程存储库中添加一些文件夹[和其中的文件] 所以我只是简单地使用 git 添加路径 然后 git push --all

完成!