Skip to content
Song Zheng edited this page Jun 5, 2017 · 2 revisions

What happens if you accidentally committed 2 answers into your pull request?

@ColinX13 has a great summary, originally posted for this pull request: https://github.com/llipio/algorithms/pull/48

...Because you have multiple solutions and tests for two questions on one branch you will need to put them on separate branches.

  1. check your repository with git remote -v to see if you have the repository for llipio. If not, you can add it by doing git remote add llip https://github.com/llipio. My remote is called llip so I'll use that as an example.
  2. you need to download the code from the remote repository into your computer: git fetch llip.
  3. change to a branch that doesn't have changes that you made so you can start clean: git checkout llip/master.
  4. create a new branch from there, I'll use h1 as an example git checkout h1.
  5. add your changes. My example will be solutions/1.js: git add solutions/1.js
  6. create a new commit by git commit -m 'message'
  7. make a pull request by git push origin h1.

Now, lets say if you want to solve another problem. Here's what you do:

  1. change to a branch that doesn't have changes that you made so you can start clean: git checkout llip/master.
  2. create a new branch from there, I'll use h2 as an example git checkout h2.

...

Good luck!

Clone this wiki locally