Thanks to visit codestin.com
Credit goes to github.com

Skip to content

documentation: improve docs for checkout_head #3822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2016

Conversation

ethomson
Copy link
Member

git_checkout_head is sadly misunderstood as something that can
switch branches. It cannot. Update the documentation to reflect this.

Fixes #2864

* do not change your `HEAD` and then call this method, that would leave
* you with checkout conflicts since your working directory would then
* appear to be dirty. Instead, checkout the target of the branch and
* then update `HEAD` if that was successful.
Copy link
Member

@carlosmn carlosmn Jun 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we mention git_repository_set_head() here, as that's the convenient way we offer to switch the active branch?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to mention git_repository_set_head.

`git_checkout_head` is sadly misunderstood as something that can
switch branches.  It cannot.  Update the documentation to reflect this.
@ethomson ethomson force-pushed the ethomson/checkout_head_docs branch from 54e8df8 to b926648 Compare June 15, 2016 20:24
@carlosmn carlosmn merged commit 3e9830d into master Jun 16, 2016
@ethomson ethomson deleted the ethomson/checkout_head_docs branch January 13, 2017 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants