I'm a noob when it comes to git.
How would I get it so I can do something like git push production master
and h开发者_如何转开发ave the remote repository mirror my own?
Currently, whenever I run git push production master
I get:
error: By default, updating the current branch in a non-bare repository
...
! [remote rejected] master -> master (branch is currently checked out)
What am I doing wrong?
Pushing to working repositories is a bit dangerous as any work in progress is not taken into account by the push, and it is quite easy to subsequently lose any uncommitted changes (basically the working HEAD can get out of step with the working branch HEAD). The full, gory details are in the following link:
git push to a non-bare repository
It is recommended that your published repository should be a bare repo which does not have a checked out tree. Bare repos are created using the "git clone --bare" option.
Aparently what I was looking for is an unconventional way to use git.
I followed http://danielmiessler.com/blog/using-git-to-maintain-your-website and got what I was looking for.
精彩评论