less than 1 minute read

Create a new branch:

git branch <new-branch-name>

Or, you can create and switch to the new branch in one command:

git checkout -b <new-branch-name>

Switch to the new branch (if you used the first command to create it):

git checkout <new-branch-name>
git add .
git commit -m "1.0.0"

Push the new branch to the remote repository:

git push -u origin <new-branch-name>

The -u flag sets the upstream (remote) branch for the local branch, so future git push and git pull commands will automatically refer to this remote branch.

OR push the branch to the remote repository without setting the upstream:

git push origin <new-branch-name>

Summing it up

With branch creation:

git checkout -b deploy
git add .
git commit -m "1.0.0"
git push origin deploy
git checkout main //switch back to the main branch

Regular update

git checkout main
git add .
git commit -m "message"
git push // git push origin.main
git push origin main:deploy