Tag Archives: git

Wait You Use a GUI for GIT?

Yes, Yes I do!

I’m a firm believer in using whatever tool you need to get the job done.

Is there shame in using a GUI?

I’m don’t believe in shaming devs for using a GUI and not using a CLI in the Terminal.

Dev shaming is toxic. It hurts people, and that’s not what we want, we want to build each other up! We want to get excited at each others accomplishments!

The tools we use to accomplish the task don’t really matter, what matters is that we build amazing software. There is no elite-ism of using one tool over another.

“You’re not a real dev if you don’t use a CLI” is a myth. Never believe those words. You’re a real dev if you can write software that works!

Why do I use both?

Personally I really use a mix of GUI and CLI. Some tasks are quick and easy in one or the other for me. For you it might be a different mix of benefits.

I prefer GUI for

  • Quick glance context: Current branch, commits behind/ahead, conflicts, other branches status, changed file count.
  • Cherry pick lines to commit, discard lines
  • Interactive rebasing & squashing with ease
  • Scrolling through exactly what lines of code I’m committing

I prefer CLI for

  • Quickly switch branches
  • Hard reset easily
  • Pull new changes
  • Committing & Pushing
  • Adding a new remote

Let’s end the culture of Dev shaming!

Changing SourceTree’s Default Remote

I’m going to talk about changing SourceTree’s default remote.

When you’re pushing a new branch, SourceTree will automatically guess which remote you wish to push to by default.

SourceTree defaults to origin

By default SourceTree will always pick origin to push a new branch to. Depending on your workflow, you may want to set another remote as your default, let’s say my-fork for instance.

SourceTree defaults pushing new branches to origin

Renaming a remote

Interestingly all we have to do is rename our remotes. Since SourceTree always picks origin we just need to rename to anything else. Perhaps to the name of owner of the repo like SproutSocial or FaceBook. It’s safe to rename the remotes, it’s just a nickname only used locally.

(I’ve never been a fan of “origin“, it’s terribly confusing and ambiguous for those learning git).

Steps to rename the remote

via git

git remote rename origin SproutSocial

In SourceTree

  • Open the repo settings (gear in top right)
  • Remotes tab
  • Click on the remote
  • Edit
  • Change the Remote Name

SourceTree Remotes Setting
Editing remote names

Changing SourceTree’s Default Remote

Once we’ve renamed origin, SourceTree will always pick the remote that comes first alphabetically. So, do the ‘ol classic prefixed by numbers. Here I’ll name them 01-my-fork and 02-origin.

Boom! SourceTree picks 01-my-fork by default!

Changing SourceTree's Default Remote
Setting your preferred remote as default

Simple workflow optimizations like this, make me happy.