Git and Github management - adam-kostuch/terminal-backend GitHub Wiki
In this page you'll find out how to add code to github / name branches / manage pull request. Just overall git management tutorial.
- First of all naming branches. Check in which project you're working and add
backend/...orfrontend/...profix. We aren't working with camel case, but with phrases separated with dashes (-). If you want to commit main page code on frontend, it'll look like this:frontend/main-pageand so on. Don't forget to work on correct branches! - Next committing changes. After you end writting your code it's a good habit to run
prettierandeslintfixing commands just in case if something broke with husky. After that you're ready to commit code (BE SURE YOU'RE ON CORRECT BRANCH). Follow the steps:
git add . # to add changes to the staging area
git commit -m "some sample comment" # to create snapshot in local project
git push # push everything to remote repository. add -f if needed
or alernativly:
git commit -am "some sample comment" # combination of git add and git commit. might not work sometimes
git push # push everything to remote repository. add -f if needed
- After all of this, open
Pull Request (PR). To well prepare PR you have to:
- Assange yourself,
- Submit person to
Reviewyour work, - Link accurate project
- And last, but not least link correct issue you're working on.
- How to link issue to PR. In the comment section of the PR write something like this
Closes #4. This syntax means that you're closing issue number 4. - PR are meant to be closed as soon as possible, but sometimes you have to leave it on it's own for a minute. Then you have to edit the name of the PR with the preffix:
DraftorWIP (Work In Progress)