views:

279

answers:

3

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  A: 

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.

kwatford
+2  A: 

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.

Greg Hewgill
why is that? with SVN if i understand is always pushing. You just need to update before doing the push. Why will you "sooner or later accidentally lose work."?
acidzombie24
AFAIK github you must push. Isnt that no longer bare once you push something onto it? i actually dont understand why i can push to github repeatedly and not to my local repository.
acidzombie24
@acidzombie24: First, SVN and Git work differently and there is no such thing as a "non-bare" SVN repository. Second, a Github repository is always considered "bare". In Git terminology, a "bare" repository is one that has *no working copy*. It does not mean that it is empty.
Greg Hewgill
A: 

I have the exact same problem as the original poster, push seems to work (I can see it in the logs) but the files aren't uploaded.

I don't understand both of the 2 answers. I've been using SVN for years, and I understand that the difference is that now I need to click on "Push" after doing a commit in order to send the files, but that doesn't seem to work (no error message).

I've been trying the whole weekend to understand and to solve the problem with no success.

I would greatly appreciate your help with simple words and clear steps (like click on the "xxxx" button then blabla... etc.).

Thank you!