11/7/2023 0 Comments Git list branches in remote![]() ![]() Please note that for both scenarios above, in order for the delete operation to be successful, you have to be on a different branch from the one you want to delete. To LEARN how to connect Git with your CI/CD Pipeline, ENROLL in our Jenkins Course: So, we can have a feature branch or a release branch for example, which are branches used in a gitflow branching strategy, that could either be a branch on your local machine (local branch) or a branch on a remote server (remote branch). These are actually popular branch naming conventions that are part of a popular branching strategy called Gitflow. Also, you might have also heard of the main branch, develop branch, feature branch, release branch, or hotfix branch. They are just concepts based on Git functionality. Please note that the terms, local branch, and remote branch are not explicitly defined in Git. Remote branch: a branch that is on a remote repository that is on a remote server where you can either push your local branches to be code reviewed and merged or pull code changes from to ensure you have the latest changes.Local branch: a branch that is in your local repository on your local machine where you as a software engineer can develop a new feature, fix a bug or test your code changes.If you deleted a branch as an oversight, you can recover it by using the git reflog command.Ī branch in Git is simply a pointer to a particular commit.Regularly deleting unused branches ensures you have a clean and organised repository, which enhances the collaboration experience.To delete a local branch, which is not a remote-tracking branch, you need to switch to another branch to successfully perform the operation.There are several ways to go about deleting branches but before we dive into that, let’s first understand the inner workings of the different types of branches. Now, you decide to first do some branch cleanup before proceeding with your tasks. So, you run the git branchcommand from your develop branch on your local machine but see a seemingly never-ending list of branches, which are primarily old feature branches that were completed and merged a while ago. But you probably don’t remember the full branch name you want to switch to. You may have been in a situation where you need to switch between tasks you are working on, which are on different branches.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |