To move a project that is actively programmed without control over the versions nowadays is a complete frenzy. Overall there are multiple options bazaar , Mercurial , Git , Svn . So here if you expect me to explain which version control is better and why it won't be. We use Git. Causes many – Easily adjusts, Very versatile, Written by Linus Torvalds to serve Linux Kernel versions, The latter are at least 2 Reasons 😉 . Today I have to create a new repository, That a new project was launched. I actually created a few repositories, and it was a long time ago when we needed it and I forgot the thin moment at that. I created the repository I pushed several files for the first storage everything went right. The repository setup itself was standard:
git init echo "Short project's description" > .git/description git config --global user.name "Your Name" git config --global user.email "[email protected]" git commit -a touch .git/git-daemon-export-ok
Basically nothing that's wrong. След това реших да тествам от отдалечена машина да съхраня съдържание и при опита да го push-на ми изгърмя с грозното съобщение:
Pushing to git://gitHost/project
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require ‘git reset –hard’ to match
remote: error: the work tree to HEAD.
remote: error: You can set ‘receive.denyCurrentBranch’ configuration variable to
remote: error: ‘ignore’ or ‘warn’ in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: ‘receive.denyCurrentBranch’ configuration variable to ‘refuse’.
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to ‘git://gitHost/project’
So obviously I try to komi in the main tree of the project and the software courteously cut Me. In general, I have no intention of making an extra branch because the people who participate in the projects are clear and order other reasons. Here comes the moment to point out that I have defined a very incompetent title but this is another moment. Overall, the solution to the problem is trivial in the. git/config of your project you need to add the following directive:
[receive] denyCurrentBranch = false
Then everything comes to the place.
http://www.youtube.com/watch?v = 16bRiH5zfOY