Git is now a common tool in software development, for version controlling. In the last post, we described about "How to rename a Git branch?". Today we are going to learn more about Git branches and it's commands.
Continue reading to know how to create/rename/move/delete/list Git branches. Also, don't forget to check other posts on Git Basics/Git Cheat sheets.
If you are working on Git Bash commands, you will regularly need to execute the basic commands. Today in this blog post, I am going to share more commands related to Git Branch and to keep them always handy with you. I hope, you will like these:
$ git branch
$ git branch -r
$ git branch -av
$ git branch <new-branch-name>
$ git checkout -t <remote-branch-name>
$ git checkout <branch-name>
$ git branch -m <old-branch-name> <new-branch-name>
$ git branch -M <old-branch-name> <new-branch-name>
(... more detailed on this topic)
$ git branch -d <branch-to-delete>
$ git branch -D <branch-to-delete>
$ git branch -d
$ git push origin :<branch-to-delete>
Was this post useful? If you came to this page by searching online about git basics, please have a look into my other blog posts. Subscribe to the RSS feed or the email newsletter to keep yourself updated. If you have any queries, you can either ping me on Twitter or drop a line below in the comments section. Have a great day!