Category Archives: Version Control

How to delete a branch in git

Git Logo
Image by Jason Long CC BY 3.0

Git encourages branching but sometimes you need to do a clean up and delete merged or orphaned branches from your local and remote repositories. Here is the procedure from the command line.

To delete a branch locally:

You may get an error like this one if the branch has not been merged yet:

This is a good reminder in case you are deleting something you should not be deleting.

To delete a branch remotely (e.g. on a GitHub repository):

How to do an svn checkout with a different username

Image by Wikipedia – Fair use licence

The other day I had to do an svn checkout from an Amazon Web Services (AWS) instance and, of course, my user name on SVN was different from the user name on the AWS instance  which is by default ec2-user.  So how to do a checkout from a Subversion repository and specify at the same time the SVN user who is performing the checkout? Subversion has a handy username parameter,  here is the full command with some dummy output.

You will be asked to enter your SVN password and if you want to store your password unencrypted. I suggest to select no for the latter for security reasons but this means that you will need to provide the SVN password every time you perform an SVN command.