To move a project in which to program active without control over versions nowadays is crazy. Generally there are multiple options bazaar , mercurial , git , svn . So here if you expect to explain which version control is better and why it won't be. In the US we use git. Cause a lot of – easy to set up, It is very versatile, It was written by Linus Torvalds for Linux Kernel version to serve, the latter are at least 2 reasons 😉 . Today I had to create a new repository, I started a new project. Actually I created some repositories and it a long time ago when we needed it and I forgot the thin at this Momento. Create multiple file store for the first hit store everything went exactly. The setting 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's wrong. Then I decided to test from a remote machine to preserve content and trying to push it-with my ugly message pops:
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 komitvam in the main tree of the project and the software politely cut me. Overall, I have no intention to make additional branch because people involved in the projects are clear and a number of other reasons. Тука идва момента да отбележа че съм дефинирал много некадърно заглавието но това е друг момент. Като цяло решението на проблема е тривиално в .git/config на проекта ви трябва да добавите следната директива:
[receive] denyCurrentBranch = false
След това всичко си идва на мястото.