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

Skip to content

Correct suggested git commands for checkout 5.x #10713

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
Jul 27, 2017

Conversation

thomasballinger
Copy link
Contributor

The current instructions suggest git checkout -b origin/5.x, but this creates a new branch off of the current commit with the confusing name "origin/5.x" instead of creating a local branch with the default upstream of origin/5.x.

Some better options include:

  1. git checkout origin/5.x - prints unnerving error message about detached head, but successfully checkout out 5.x
  2. git checkout -b 5.x origin/5.x - create a new branch off of origin/5.x, tracking origin/5.x - unfortunately confusing to type
  3. git checkout 5.x - for git 1.7.2.3 (2010) and higher (according to second hand source) does the same as command 2.
  4. git checkout --track origin/daves_branch does the same for even older versions of git.

I propose git checkout -b 5.x origin/5.x so as to make no assumptions about git version and to avoid the "detached head" warning that can be unnerving, and to prepare users to later pull to a tracking branch for updates. But we can rely on git version installed being less than 7 years old, git checkout 5.x would be better.

@thomasballinger
Copy link
Contributor Author

#9900 is relevant as that's where this language comes from

@takluyver takluyver added this to the 6.2 milestone Jul 25, 2017
@takluyver
Copy link
Member

Thanks! +1 to the shorter, more modern spelling if you want to update this PR.

The current instructions suggest `git checkout -b origin/5.x`, but this creates
a new branch off of the current commit with the confusing name "origin/5.x"
instead of creating a local branch with the default upstream of origin/5.x.

Some better options include:
1. `git checkout origin/5.x` - prints unnerving error message about detached head, but successfully checkout out 5.x
2. `git checkout -b 5.x origin/5.x` - create a new branch off of origin/5.x, tracking origin/5.x - unfortunately confusing to type
3. `git checkout 5.x` - for git 1.7.2.3 (2010) and higher (according to [second hand source](https://stackoverflow.com/questions/9537392/git-fetch-remote-branch)) does the same as command 2.
4. `git checkout --track origin/5.x` does the same as command 2 for even older versions of git.

This commit uses `git checkout 5.x` since seven years is a long time.
@thomasballinger
Copy link
Contributor Author

Updated to use shorter, more modern spelling.

@takluyver takluyver merged commit 907885b into ipython:master Jul 27, 2017
@takluyver
Copy link
Member

:-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants