Make sure to pull all recent changes to main to start the branch-off process.
- Branch naming:
[front/back]
/[feat/fix/bug/refactor]
/[issue # -]something-worked-on
- Eg:
front/feat/login-form-component
- Eg:
front/fix/nav-items-wrap-on-mobile
- Eg:
back/feat/get-items-route
To add a branch
checkout -b 2-user-data-json
Commit AS OFTEN as you can!!! Commits really matter!. You SHOULD NOT do everything in 1 commit!
'cd' into main branch
do git pull
'cd' into working branch
do git merge __branch_name
if there are merge conflicts, fix them and commit the changes
Now that you are done, and everything has been commited, you are going to PUSH the BRANCH
into github.
git push origin __branch_name__
On github, create a pull request by, clicking Pull Requests
button, then clicking the new pull request
button on the page. Pick your branch, and fill out the form to generate a Pull request.
That means anyone can review people's codes. This is a good practice to see how other people are coding, and using different methods.
- There are 2 ways to fix it, one way, github will give you the tools ( BAD WAY)
- Switch to main/master, pull all the changes, switch back to your branch, MERGE master INTO your branch and fix the conflicts!
Once you fixed them, push the branch back out, and your pull request
will be updated.
Scroll down to Merge Pull Request
Click the button, Click confirm merge
and now everything will be added into your master/main branch.