Clean-up

Clean-Up the repository

I push the code of all issues in a single pull request. So it was quite difficult to merge the code and my mentors told me to clean-up the code of the repository. I need to create new branches corresponding to each issue that have the code which address to the specific issue. She told me one command that help to do so which is cherry-pick command. I read some documentation about cherry-pick command and tried this by creating a new branch it shows some conflicts. I push the code after resolving all the conflict. Now it create new branch but it shows all the commits not the specific one. So I discuss this with mentor she assist me. Following are the commands that is used to create a new branches and push the specific commmit to the branch:

Step 1: Make sure you are on the clean branch before you make a new branch

   $ git checkout -b <branch>

Step 2:

   $ git reset --hard <latest commmit-hash>

Step 3: Create a new issue branch:

   $ git checkout -b <issue-branch>

Step 4: Use cherrypick command with the commit-hash you want to push in the issue branch:

   $ git cherry-pick <commit-hash>

Step 5: If there are conflicts and then do:

   $ git status 

Resolve them.

   $ git add .
   
   $ git cheery-pick --continue

   $ git push origin <issue-branch>

And If there is no conflicts, then do:

   $ git push origin <issue-branch>

Step 6: At last $ git checkout clean-branch`

Step 7: Repeat the steps from the step 3 to step 6 for every commits that solve the issue.

Written on July 27, 2016