Question

FYI - I'm a relative amateur with git, having used it for a couple of years but only on a very basic level. This is probably a beginner-level question.

I'm collaborating on a git repo. I created a topic branch named foo, made changes, committed, pushed, and sent a pull request for my other collaborators to review and merge.

The pull request is going to take them some time to review. In the meantime, though, I want to continue to contribute to master, but I also want to keep using the changes I've made locally in foo. Is there a way to do that?

Likewise, if they make changes to master that I want to pull, can I somehow get those changes into foo (or otherwise use the latest code from both branches) without polluting that branch?

Was it helpful?

Solution

You can branch off your foo branch (let's call the new branch bar) and commit on this one. You will be able to rebase this branch when changes occur in master. Once foo is merged into master all your changes will already be in there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top