Reputation: 3511
I am doing open source contribution on Github, still fairly new to using command line to performance git actions.
My situation now is:I made a pull request to an open source project with 10 commits. The pull request hasn't been approved yet. That means I am 10 commits ahead of remote open source master.
What I want to do is:I want my remote repo and local repo matches the remote open source repo. So that I can contribute to other features because the new feature does not rely on the new code.
My question is:What should I do in this case? Revert the commits or make a new repo from open source project?
Thank you in advanced.
I had created a new branch for new feature development. And I merged the branch to my master.
Upvotes: 0
Views: 2189
Reputation: 5831
Since you created a branch from remote master, and merged the new branch to master after some commits, your local master is ahead of remote master. You need to reset your local master to remote master.
There are various ways of doing it. As you mentioned, one is to revert all the commits, which I don't recommend. Here are a couple of ways (#2 is easier):
git checkout <sha>
You can get the sha by doing a git log
and checking the last commit not done by you. That commit will have a unique identifier(SHA).
-OR-
git reset origin/master
Then do git checkout -b branch_name
This way you don't have to revert your commits and once your new feature is done, you could merge your branch_name branch to master and request a pull.
Upvotes: 1