Consider, there is two branches
I need to add authentication api.
Then I will create new branch from
1. Create Feature Branch
# First, change base branch to develop $ git checkout develop # Next, create new feature branch from develop $ git checkout -b feature/auth-api
2. Make Changes And Commit the Changes
Then, I might commit some changes and updates. Add new api, add configurations. Do whatever is needed.
git add [CHANGED FILENAME] git commit -m "[YOUR COMMIT MESSAGE]"
After committing all changes, now is the time to rebase.
git pull --rebase origin develop
which rebases your base commit, conforming to origin.
4. Push the Changes
Then, push your changes to the remote.
git push origin feature/auth-api
Create a pull request, get some code reviews, and merge your pull requrest.
5. Pull Origin
develop and pull the origin.
git checkout develop git pull origin develop
6. Remove Feature Branch
Finally, remove the feature branch.
$ git branch -D feature/auth-api # Tell remote about deleting the feature branch. $ git push origin --delete feature/auth-api