Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github pull request without old commits

I have forked project at github. I make one commit and pull request it. This commit was approved. Then i make second commit and pull request it too. But in pull request there were 2 commits: my second commit and old commit which was approved. How can i sync my repository and main repository?

like image 835
0xAX Avatar asked Mar 24 '11 06:03

0xAX


People also ask

How do I hide previous commits in GitHub?

Hide commit history on Git Branch First, create a new temporary branch and checkout. Now, add all the current files to this temporary branch. Create a new commit. Rename the temporary branch to your old branch name.

Can I add new commits to pull request?

You can commit changes on a pull request branch that was created from a fork of your repository with permission from the pull request creator. You can only make commits on pull request branches that: are opened in a repository that you have push access to and that were created from a fork of that repository.

How do I delete old commits?

First, remove the commit on your local repository. You can do this using git rebase -i . For example, if it's your last commit, you can do git rebase -i HEAD~2 and delete the second line within the editor window that pops up. Then, force push to GitHub by using git push origin +master .


1 Answers

Merge back from the upstream repository, or create the new pull request on a new branch.

Or rebase on top of upstream:

git remote add upstream (url-for-upstream-repository)
git fetch upstream
git rebase upstream/master
git push -f origin
(do new pull request on website)
like image 76
Adam Vandenberg Avatar answered Oct 15 '22 17:10

Adam Vandenberg