Skip to content

Latest commit

 

History

History
29 lines (26 loc) · 2.38 KB

WorkingGit.md

File metadata and controls

29 lines (26 loc) · 2.38 KB

Learn To Code Online By Clicking Here

When working with git there are some best practices.

  • always have a branch for a specific need (bug, feature, etc)
  • when done, delete branch on server and locally (you can always recreate)

Steps For Working With Git

  1. Create branch from main
    • if done locally, you will need to:
    • if done on GitHub, you will need to:
      • create branch on GitHub
      • on local git, ensure you're working on master branch
      • pull from remote
  2. Perform your work
  3. Add changes to git staging
  4. Commit changes
  5. Push to remote branch (not origin)
  6. Request pull on GitHub to merge into master
  7. Checkout your master branch
  8. In git, run git pull and fix any merge issues. (Which there shouldn't be. If there are, fix and then do a git push REMOTENAME master)
  9. Checkout your branch when ready to work again.
  10. Perform a merge between this branch and master: git merge master BRANCHNAME
  11. Push this change (even if just a Fast-forward update) to GitHub
  12. Continue steps 2-11 until ready to close/delete your branch.
  13. When done with branch, run: git checkout master
  14. Follow the steps to delete your branch.