git checkout main
git branch <your branch name>
git checkout <your branch name>
Shorter version:
git checkout main
git checkout -b <your branch name>Add new commits to your local branch (just a recall):
git add .
git commit -m "<your commit message>"Push to GitHub (remote) for the first time:
git push --set-upstream origin <your brance name>Push to Github (remote), if the branch is already pushed:
git pushUpdate your branch (main or feature).
git pull- Change to main.
- Pull main.
- Change to your feature branch.
- Merge main to your feture branch.
git checkout main
git pull
git checkout <your feature branch>
git merge mainA shorter version:
- Change / stay on your feature branch.
- Fetch the changes from GitHub (remote).
- Merge origin/main to your feature branch
git checkout <your feature branch>
git fetch
git merge origin/maingit remote -v