git Archives - Thoughts https://blog.jstassen.com/tag/git/ A place for collecting my miscellaneous thoughts. Thu, 01 Oct 2020 17:30:17 +0000 en-US hourly 1 https://wordpress.org/?v=7.0.7 92836340 Wait You Use a GUI for GIT? https://blog.jstassen.com/2020/07/wait-you-use-a-gui-for-git/ https://blog.jstassen.com/2020/07/wait-you-use-a-gui-for-git/#respond Thu, 02 Jul 2020 06:21:01 +0000 http://blog.jstassen.com/?p=1085 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 … Continue reading Wait You Use a GUI for GIT? →

The post Wait You Use a GUI for GIT? appeared first on Thoughts.

]]>
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!

The post Wait You Use a GUI for GIT? appeared first on Thoughts.

]]>
https://blog.jstassen.com/2020/07/wait-you-use-a-gui-for-git/feed/ 0 1085
Changing SourceTree’s Default Remote https://blog.jstassen.com/2017/10/changing-sourcetrees-default-remote/ https://blog.jstassen.com/2017/10/changing-sourcetrees-default-remote/#respond Thu, 26 Oct 2017 00:57:27 +0000 http://blog.jstassen.com/?p=888 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 … Continue reading Changing SourceTree’s Default Remote →

The post Changing SourceTree’s Default Remote appeared first on Thoughts.

]]>
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.

The post Changing SourceTree’s Default Remote appeared first on Thoughts.

]]>
https://blog.jstassen.com/2017/10/changing-sourcetrees-default-remote/feed/ 0 888