Reputation: 91
I created a repo, added the files, cloned it to my local machine, made changed, commited them, pushed them onto the Server but the changes are not in the files on the server. My commands where the following:
On the server:
git init
git add *
git commit
I wrote the commit with initialize as comment.
Then i cloned it to my local machine using:
git clone user@ipadresse:/path/to/.gitfolder
I then noticed a little Problem with the Repo being non bare so I ran
git config --bool core.bare true
on the Server.
I created some folders and files in the repo localy added them and commited them. I then pushed it onto the server and got the following output
Counting objects: 100% (18/18), done.
Delta compression using up to 8 threads
Compressing objects: 100% (8/8), done.
Writing objects: 100% (12/12), 1.83 KiB | 469.00 KiB/s, done.
Total 12 (delta 2), reused 1 (delta 0), pack-reused 0
To ipadress:/path/to/.gitfolder
881e1dc8..62ec93d9 master -> master
But the new files arent there.
When i run the command git branch -a -v -v
on the Server I see the commit message from my local change.
So why isnt it changed on the Server and how do I get my updates there?
Upvotes: 0
Views: 372
Reputation: 488183
Like most other core
settings, core.bare
is descriptive (describes the actual setup), not prescriptive (changing it does not change the actual setup). So you should not just change it. Just changing core.bare
is like going out to a traffic light, taping over the red signal so that it never shows that you should stop, and making the green signal look always-lit-up so that you can always go. It may even actually work for a while, until the eventual, inevitable traffic collision.
Normally, to make a bare clone—as needed to enable git push
—you would use git clone --bare
. It is possible to convert a non-bare clone to a bare one (or vice versa); see How to convert a normal Git repository to a bare one? and note the "remove working copy" step.
If you want some1 newly-git push
-ed commits automatically checked out into a non-bare repository, see VonC's answer to cannot push into git repository (similarly in pushing to a git repository does not work).
1For a description of what commits will or won't get deployed this way, see those answers and also the Git documentation.
Upvotes: 1