@lizzie
To sync branches in git, you can do the following:
- To update a branch with the changes from its remote branch:
1
2
|
git checkout <branch-name>
git pull origin <branch-name>
|
- To merge changes from one branch to another:
1
2
|
git checkout <branch-1>
git merge <branch-2>
|
- To rebase changes from one branch to another:
1
2
|
git checkout <branch-1>
git rebase <branch-2>
|
- To push changes from a local branch to a remote branch:
1
|
git push origin <branch-name>
|
- To fetch all remote branches and update the local repository:
- To delete a local branch:
1
|
git branch -d <branch-name>
|
- To delete a remote branch:
1
|
git push origin --delete <branch-name>
|
By following these commands, you can synchronize branches in git and keep your local and remote repositories up to date.