I’m using Git now from my Windows machine.
I clone the repo, do some changes and push.
Until here everything works fine.
But when I commit for example a test.txt in my local folder and push,
then look into my remote repo and do
git log:
shows the commit message
git status:
file deleted “test.txt”
What’s that?
Why ‘file deleted “test.txt”‘?
The file should be created!
I then can commit the change of the file’s deletion and when I pull to my local folder again, the file get’s deleted again in the local folder as well.
Any Help?
Yours, Joern.
You mention that you use gitosis, but from the command output you provided my only conclusion is that your gitosis setup is COMPLETELY broken.
First thing I notice is that you are asked for a password, and it appears you entered it and the push continued on. The server should never ask for a password, if it does then its a sign that you aren’t providing the correct ssh keypair to the server or the server is misconfigured and should result in an aborted push attempt since the account gitosis is using should not have a password set. By using a password it means you are overriding everything that gitosis is designed to do and you might as well just remove it because its not being used at all.
Second thing I noticed is you are pushing to
/var/www/saris/.gitwhich by standard naming convention indicates a non-bare repo. Again you seem to be going around everything gitosis does because gitosis only works with bare repos. In addition this is exactly why you see no changes on the server. When pushing to a non-bare repo the working tree is never updated so the effect you seem to be trying to get (updating a website in /var/www/saris) will not work. See https://git.wiki.kernel.org/index.php/GitFaq#non-bare and http://toroid.org/ams/git-website-howto for more information about non-bare repos and managing websites with git.Additionally I like to point out whenever possible that gitosis is unmaintained and deprecated by the git community in favor of the superior gitolite.
EDIT: You’ve completely removed the original question and replaced it with another unrelated question and lost all the original details. You should have just created a new question but I’ll answer your new question anyway.
Your new question is essentially one of the most basic and common git questions. It is asked so often that it has its part of the GitFaq which I’ve copied to here and even linked when I answered your original question.
Again please read http://toroid.org/ams/git-website-howto which I linked when I answered your first question. If you use that solution you will not have this problem.