Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Talk:EGit/Git For Eclipse Users"

(Example needs additional configuration setting)
 
m (Bare repository: new section)
Line 2: Line 2:
  
 
Platform: msysgit 1.7.0.2-preview20100309, Windows7.
 
Platform: msysgit 1.7.0.2-preview20100309, Windows7.
 +
 +
== Bare repository ==
 +
 +
To avoid getting an error like this:
 +
 +
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:
 +
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:
 +
remote: error: To squelch this message and still keep the default behaviour, set
 +
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
 +
 +
 +
I have added a couple of lines to the tutorial.  Just after we create the second "other" repository we need to tell git that it is a bare repository so we can push to it without having to set the "receive.denyCurrentBranch" config variable.  Also added a line that will switch back from bare repository so we can perform the checkout.

Revision as of 20:59, 16 February 2011

The tutorial (which is great, by the way) works for me only when setting receive.denyCurrentBranch to ignore. Problem is: Without this setting I cannot push into the checked out branch.

Platform: msysgit 1.7.0.2-preview20100309, Windows7.

Bare repository

To avoid getting an error like this:

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: 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: remote: error: To squelch this message and still keep the default behaviour, set remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.


I have added a couple of lines to the tutorial. Just after we create the second "other" repository we need to tell git that it is a bare repository so we can push to it without having to set the "receive.denyCurrentBranch" config variable. Also added a line that will switch back from bare repository so we can perform the checkout.

Copyright © Eclipse Foundation, Inc. All Rights Reserved.