FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Gitwash clarifications by mdboom · Pull Request #24 · matplotlib/matplotlib · GitHub

Repository navigation

Gitwash clarifications - #24

Merged
mdboom merged 4 commits into
matplotlib:v1.0.xfrom
mdboom:gitwash_clarifications
Apr 4, 2011
Merged

mdboom merged 4 commits into
matplotlib:v1.0.xfrom
mdboom:gitwash_clarifications

Conversation

mdboom commented Feb 26, 2011

Copy link
Copy Markdown
Member

I'm struggling with my early experience with git and these instructions here. I'm trying to clarify these instructions to avoid confusion and future mistakes for others, but I'm not 100% certain these changes are correct.

Additionally, there are some questions in here as comments where I'm not sure how things should be filled in.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is this best practice, or should I make a local v1.0.x first and then create the feature branch off of that?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I don't see any real reason to create an intermediate local branch.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Either one should be fine. Personally, I have a local v1.0.x branch that I set up to track matplotlib/v1.0.x, not darrendale/v1.0.x. I don't want to worry about keeping my remote darrendale/v1.0.x branch in sync with matplotlib/v1.0.x.

I think the best practice can be stated thus: if the remote has a branch v1.0.x and you make a local copy of it, the state of your local copy should not diverge from the remote. Use "git pull" occasionally to keep it in sync with the remote, and especially when you are about to do a merge. The only time the state of your local copy should diverge from the remote is right before a push, when you do the merge. Right after the push, your local copy and the remote are once again in sync.

By the way, this:

git branch my-new-feature remotes/origin/v1.0.x
git checkout my-new-feature

is equivalent to:

git checkout -b my-new-feature remotes/origin/v1.0.x

and it also appears to be equal to:

git checkout -b my-new-feature origin/v1.0.x

One final comment: I find the "origin" and "upstream" convention to be confusing. Instead, I name my remotes after the github profiles: "matplotlib" instead of "upstream", "darrendale" instead of origin. Its a little more concrete.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

After reading Jouni's comment and rereading my own, I think I agree that it is easier to not have an intermediate, local v1.0.x branch.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think changing the two commands to "git checkout -b my-new-feature origin/v1.0.x" makes sense.

ivanov commented Mar 24, 2011

Copy link
Copy Markdown
Member

can we add a note about doing how useful

git push --dry-run

can be, especially in case you're passing the -f flag.

In my case, I had pushed some commits to github, but then made changes to the last commit that was pushed out using "git commit --amend", which meant (I think) that I had to do a "git push -f" in order to lose the old (unamended) commit.

Copy link
Copy Markdown
Member

Can we add a note never to do git push -f on the upstream repository?

You likely did need -f in that case, but your branch was tracking the upstream matplotlib repository and not your own. A possibly safer way to achieve this might have been git push my-repository +my-branch, where the plus means the same as -f.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Typo at end of line: you have a semicolon instead of a colon in the next-to-last character.

mdboom commented Apr 4, 2011

Copy link
Copy Markdown
Member Author

I know this pull request has set here for a while. How does everyone feel about this after incorporating Jouni's improvements etc. Ready to merge?

ddale commented Apr 4, 2011

Copy link
Copy Markdown
Contributor

I wanted to revisit the discussion on integration branches one more time, but I may not get to it for a couple days and don't want to hold up this pull request any longer. If I want to suggest any changes, I can do it in a separate branch.

mdboom commented Apr 4, 2011

Copy link
Copy Markdown
Member Author

Sounds good. Just wanted to make sure there wasn't any advice in here that was actively detrimental ;)

mdboom merged commit 4b7f4b8 into matplotlib:v1.0.x Apr 4, 2011

ivanov commented Apr 4, 2011

Copy link
Copy Markdown
Member

some of us are quite capable of being actively detrimental even in the absence of any advice :)

richbwood mentioned this pull request Dec 19, 2012
magnunor pushed a commit to magnunor/matplotlib that referenced this pull request Dec 5, 2013
BUG-FIX: same as changeset 3affca88be30 but in signal branch
swfiua pushed a commit to swfiua/matplotlib that referenced this pull request Mar 17, 2017
Please Welcome Eric Idle to Karma Pi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

6 participants


Back | FazBrowse Home | New Git URL