general workflow of git

  1. fork to my github

  2. git clone git url (the place where project will put)

  3. cd theNameOfFolder

  4. git remote add --track master upstream git url

  5. git fetch upstream

  6. git merge upstream/master

  7. git branch newBranch

  8. git checkout newBranch(on the newBranch branch)

Now you're getting ready to start hacking, you'll want to switch off of the 'master' branch and onto a different branch for your new feature. It's important to do this because you can only have one Pull Request per branch, so if you want to submit more than one fix, you'll need to have multiple branches.

  1. git status(check what has been edited or added)

  2. git add . //add all modified files; git add fileName//add one file

  3. git commit -m "commit itselfe

  4. git push -u theBranchName(first time push) / git push theBrunchName(2 and after push)

Then go to that page on GitHub and change branches to the one for your new feature.

Then, click on the button 'Pull Request'. This will bring you to a page asking you to describe your change. Describe it thoroughly.

Then press 'Submit Pull Request'.

the reference:

https://www.gun.io/blog/how-to-github-fork-branch-and-pull-request

Keep the upstream the latest of the original master, diff from the fork clone master in the local.

Last updated