I like Git a lot and I know how to use it fairly well.. I wouldn't consider myself an ultimate expert – more like an intermediate user that has found themselves in weird situations with Git and, most of the time, figuring out how to get out of them

My main issues with Git, especially in our standard world of pushing changes and then going to a website to make a merge requests, it's a little low level. Don't get me wrong – I think merge requests are great not only for someone to look at your code but also for teaching moments! But making a branch in the right format, constantly pulling in the parent branch, pushing and making a MR… that is a lot of manual steps!

When I stumbled on Git Town, I was a little bit suspicious but I tried it out anyway.. and I found it incredibly good. It basically wraps a lot of what I specified above into a couple of steps that generally do the right thing.

You can look at the install and usage on your own – no sense in me listing that here. But here is how I use it:

I first say "Oh I need to work on ticket X" so I type:

> git hack TICK-123-some-witty-name

That will:

  • get the latest from main or whatever my configured parent branch is
  • create a branch named TICK-123-some-witty-name and have it in that folder.

Note it doesn't matter what branch originally was on when I created that branch. When I want to hack, it always starts it from main (or whatever parent).

So I'm working along and note there are some changes in main that have been push. I then will type:

> git sync

Now only will that grab the changes from main and put it in my current –hack– feature, but will put the changes in main to all the other features I have checked out. Neat huh?

If I need to switch back to another feature that I was working on, I would do :

> git switch <name>

and then it will switch the branches. Note that with the early sync command, I have an updated branch!

Finally, my favorite one – when I'm ready to make a MR. I simply do:

> git propose

And it will make sure it's sync'ed with the parent, push up the changes and use the API of the server (which you configured earlier) to make a MR, give you the link and even open the browser for you!

There are many other git-town commands but that is really want I do. I also use it with git-worktrees a lot. Basically I put each hack into it's own folder and that minimizes when I use the switch command.

I really like this… it's less manual steps that you would do anyway. Give Git Town a try!