Skip to content

Better workflow #58

@moshez

Description

@moshez

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions