Warning updating the currently checked out branch

6 - Then, after the commit, I try to use the command 'git push' with defaults to my origin and the master branch but I always get the same error message: [email protected]'s password: Counting objects: 5, done. Total 3 (delta 2), reused 0 (delta 0) 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 inconsist ent remote: error: with what you pushed, and will require 'git reset --hard' to matc h remote: error: the work tree to HEAD.

remote: error: remote: error: You can set 'Current Branch' 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.

However when the branch is checked out only by other working trees, deleting incorrectly succeeds.

Use find_shared_symref() to check if the branch is in use, not just comparing with the current working tree's HEAD.

A bare repository is one without a checked out working copy of the code. As a general rule you should never push into a repository that contains changes in the working copy.

To ensure this doesn't happen, we're making the server repository a bare repository - it has no working copy From here: Note that the target of a "push" is normally a bare repository (i.e., with no work tree of its own).

If you find yourself pushing to a non-bare repo, it probably means you're doing something wrong.

If a detached work tree is defined (which can for instance correspond to a web server's Document Root), you need to : I made my repository bare by cloning a new, bare, repository from my messed up one, saving the messed-up one just in case, and replacing it with my cloned bare one.

I'm new to git, and when I set up the repsitory, I forgot to use the --bare option. I've since read the O'Reilly git book and now am a total git convert.

Hello, I am having an error when I try to push my changes to a remote repository.

This is a sumarry of what I did: 1- On the remote server, create the repository using 'git init /root/my_project' 2 - On the remote server, I added the files with 'git add file.txt' 3 - On the remote server, I've commited my changes with 'git commit -a -m "description of commit"' 4 - On my machine, I've used git clone ssh://[email protected]/root/my_project/ 5 - Then on my machine, I make some changes to files and commit them using the same commands as on the remote server. Writing objects: 100% (3/3), 317 bytes | 0 bytes/s, done.

Search for warning updating the currently checked out branch:

warning updating the currently checked out branch-29warning updating the currently checked out branch-56

A submodule allows you to keep another Git repository in a subdirectory of your repository.

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “warning updating the currently checked out branch”