What are the consequences of using receive.denyCurrentBranch in Git?

Why Git won’t let you push to non-bare repositories The original poster says: One solution is to run the following command: git config receive.denyCurrentBranch ignore After this it works, but I would like to know why I need to use this option. Is this the only option? What are the consequences of doing this? As … Read more

Why is it not a commit and a branch cannot be created from it?

For those who found this searching for an answer to fatal: ‘origin/remote-branch-name’ is not a commit and a branch ‘local-branch-name’ cannot be created from it, you may also want to try this first: git fetch –all If you run git checkout -b local-branch-name origin/remote-branch-name without fetching first, you can run into that error. The reason … Read more

How to convert a normal Git repository to a bare one?

In short: replace the contents of repo with the contents of repo/.git, then tell the repository that it is now a bare repository. To do this, execute the following commands: cd repo mv .git ../repo.git # renaming just for clarity cd .. rm -fr repo cd repo.git git config –bool core.bare true Note that this … Read more