Push git branch to remote or creating remote branch But to switch to any existed branch we use normal git checkout command. So this command will useful only when you are creating a new branch. You can see in the image that I created branch name called sony and I switched to that branch with this single command. So this command will do both the two things one is it will create a new branch and it will switch to that branch. We can use below command git checkout –b Instead of creating a new branch and then doing a checkout to switch to that branch create a new branch and switch to that branch In the above step I created devops branch and I switched to it. So it will switch from master to devops branch and by using this command we can switch to already existed branch only. To switch from one branch to another branch we use git checkout command git checkout So it will create a branch name called devops, and now you can check whether the branch is created or not by listing all branches with git branch command.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |