tortoisegit push successfully, but no new files?

淺唱寂寞╮ 提交于 2019-12-13 16:23:18

问题


I have setup a git repository in a linux server, and installed the latest MSysGit and TortoiseGit on my Windows 7 laptop. I can pull from the remote repository by TortoiseGit, and I can commit & push to remote repository too. If I run "git log" in the remote server, it can show the latest comments correctly. But the new files are missing in the remote server. Please advise and suggest. Thank you so much.


回答1:


It is highly recommended that you never push to a *non-*bare repository. Instead, you should create a bare repository that is a clone of your remote repository. The laptop will push to the bare repository, then the remote repository will pull from the bare one.

If you push to the non-bare repository, you will sooner or later accidentally lose work.




回答2:


The index has been updated, but not the workspace. To update the workspace, use git reset. If you have uncommitted modifications, make sure to commit them, git stash them, or use git reset --hard if you don't mind losing them.

edit: Probably a moot point by now, but it looks like git reset by itself isn't enough - use git reset --hard.



来源:https://stackoverflow.com/questions/1698552/tortoisegit-push-successfully-but-no-new-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!