Skip to content
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

DOC: dev: stop recommending keeping local master updated with upstream/master #7300

Merged
merged 1 commit into from
Feb 21, 2016

Conversation

pv
Copy link
Member

@pv pv commented Feb 21, 2016

Use the simpler git fetch; ... upstream/master approach instead of
updating the local master branch. Keeping the local master branch
in sync with upstream is usually not necessary.

…m/master

Use the simpler `git fetch; ... upstream/master` approach instead of
updating the local master branch. Keeping the local master branch
in sync with upstream is usually not necessary.
Finally create a new branch for your work and check it out::

git checkout -b my-new-feature master
git checkout -b my-new-feature upstream/master
Copy link
Member

Choose a reason for hiding this comment

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

Out of curiosity, does this also update the master 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.

No, it does not fetch.

Copy link
Member

Choose a reason for hiding this comment

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

The patch links have to point backward to something, so that something can be elsewhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it has to exist locally. However, if you have added remotes via git remote and do git fetch (or git pull), git mirrors locally the branches of the remote repo and the corresponding commits, assigning names <name-of-remote>/<name-of-branch> to each remote branch. You can get a list of such mirrored remote branches via git branch -r. As the data is available locally, these work similarly as local branches (don't know what happens if you try to modify them manually --- probably nothing, your changes are just discarded on the next fetch).

Copy link
Member Author

Choose a reason for hiding this comment

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

If you look at your .git/config, you have something like this there:

[remote "upstream"]
        url = git://github.com/scipy/scipy.git
        fetch = +refs/heads/*:refs/remotes/upstream/*

which determines what is fetched, and how the names are mapped.
Note that github stores pull requests in namespace refs/pull/, so if you're feeling brave, you can add a second fetch mapping:

[remote "upstream"]
        url = git://github.com/scipy/scipy.git
        fetch = +refs/heads/*:refs/remotes/upstream/*
        fetch = +refs/pull/*/head:refs/remotes/upstream/pr/*

so that after git fetch all pull requests appear as mirrored branches named along the lines of upstream/pr/7300.

Copy link
Member

Choose a reason for hiding this comment

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

Interesting.

charris added a commit that referenced this pull request Feb 21, 2016
DOC: dev: stop recommending keeping local master updated with upstream/master
@charris charris merged commit b3ad4f0 into numpy:master Feb 21, 2016
@charris
Copy link
Member

charris commented Feb 21, 2016

Thanks Pauli.

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.

None yet

2 participants