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

Better workflow #58

Open
moshez opened this issue May 12, 2020 · 3 comments
Open

Better workflow #58

moshez opened this issue May 12, 2020 · 3 comments

Comments

@moshez
Copy link

moshez commented May 12, 2020

Hi! I wanted to discuss this before opening a PR.

This is not the workflow I use, and not the one I would recommend. If you do this, your master branch will fall behind upstream master, and you will have to play tricks to update it which are, in general, a pain and give little value.

Instead, I reverse the step.

I git clone from upsteam: git clone git@github.com:catalinpit/OSS-Contribution.git.

I create the branch with git checkout -b my-branch, and do whatever changes I need.

Only then do I fork, and then add a new remote:

git remote add mine git@github.com:moshez/OSS-Contribution.git

Then, I push the changed branch to mine:

git push --set-upstream mine my-branch

(After that I open a PR as detailed currently).

What is the advantage?

Often, it will take some time for your PR to be considered. This means that one of the comments you might get is "your code is out of date with master". In that case, you just

$ git checkout master
$ git pull --rebase
$ git checkout my-branch
$ git rebase my-branch

With the suggestion you have here, you would need to add a new remote upstream, and then either push changes from master to upstream, or git rebase my-branch upstream/master, neither of which are that intuitive.

@moshez
Copy link
Author

moshez commented May 12, 2020

(For people who read this: this is also a good example of open source contribution workflow: if your contribution is non-trivial, it is often a good idea to open an issue and discuss the change before directly opening a PR.)

@catalinpit
Copy link
Owner

This is interesting. I never thought about this.

Thank you for the information. Open a PR if you wish. :-)

@ghost
Copy link

ghost commented Dec 28, 2020

@moshez I tend to follow what it says on the code-of-conduct.md and contributions.md first if the repo has them (generally opening an issue and getting a task, so far), else I do the same. The only difference is when I'm doing more than one commit, then I prefer to draft the PR pending review, some repos seem to lose track of what they merge easily. I found that doing this is the minimum I can do to show respect for their work. It's still a bit confusing at times to understand how each repo works, this seems to be making it more relaxed and pleasant for everyone, at least for the time being...

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

No branches or pull requests

2 participants