how to check in which brach we are in git
git branch -a # it will show an astrick * like *master
git branch --show-current # source == git remote --help
how to check in which brach we are in git
git branch -a # it will show an astrick * like *master
git branch --show-current # source == git remote --help
how to swap branch git
[git checkout "branch_name"]
is another way to say:
[git checkout -b branch_name origin/branch_name]
in case "branch_name" exists only remotely.
[git checkout -b branch_name origin/branch_name] is useful in case you have multiple remotes.
Regarding [git checkout origin 'another_branch'] I'm not sure this is possible, AFAK you can do this using "fetch" command -- [git fetch origin 'another_branch']
git change branch
git switch <branch_name>
#Ex: git switch main
(OR)
git checkout <branch_name>
#Ex: git switch dev
git change branch
$ git branch iss53
$ git checkout iss53
git change branch
git switch <branch_name> // switches to branch
git checkout <branch_name> // deletes file that were not pushed and just copies the branch to local repo
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us