-
Notifications
You must be signed in to change notification settings - Fork 1
Tips to avoid git branches conflicts
Scrappers Team edited this page May 18, 2022
·
3 revisions
- Recall, you want to add 2 new features : -foo -baz, then follow these steps :
- Create 2 branches from the master :
git checkout -b 'foo-feature' master
git checkout -b 'baz-feature' master
- Now start by one of them, for example
baz-feature
. - Do your changes to
baz-feature
. - Add your changes using :
git add ./foo-folder
- Commit your added directories.
git commit -m 'foo-message'
- Now push onto foo-feature.
git push --set-uptstream https://github.com/Organization/REPO-NAME foo-feature
- Then create a PR.
- Repeat the same thing with
baz-feature
.
- Avoid this :
git checkout -b foo-feature
git checkout -b baz-feature
Because, this creates the new branches from the current ones, this will show conflicts if the parent branch has a changeable PR. --All branches should be created from the master--