问题
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