Command Line git

I decided to use the command line version of git. I have to admit though, the gui version is much easier. In order to utilize cmd line git in a useful way I need to have this in my lap: https://git-scm.com/book/en/v2

However, it seems with a bit of digging and tutoring, I can achieve everything with it so far. I am also trying out the Windows Subsystem for Linux (WSL) and I like it a lot…had some issues with gdb debugging in some C programming, but pretty good regardless.

Here are some screen shots of the cmd line git:

image

image

image

1 Like

That’s a good thing.

Here’s the secret (-not-secret): you can certainly achieve everything with it, because you can’t really achieve anything but a fancy GUI with the GUI clients :smiley:

They ALL drive the command line git under the hood, without exception.

The git command line is so varied in its capabilities that no GUI in its right mind would even try to replicate everything that the command line can do; it’s a subset in every case (and for better or worse in some of them - e.g. I’m known for lambasting Github Desktop as being barely functional).

I don’t know if you’ve looked into aliases yet but these are good for me for a few reasons:

  1. It simplifies the specific combination of parameters I need to etch out for any task.
  2. It gives me consistency as I don’t forget a part of those combinations anymore
  3. As it becomes part of my git configuration, I can easily reference the alias definition to remind me of what that command contains and is doing in that instant

As an example, I add this one on all my workstations:

git config --global alias.glog log --oneline --graph --decorate

Now I can just type git glog in any repository and get a basic summarised ‘graphical’ log view:

In the end, I would say find a good client and use it (I’d pimp Fork as my personal favorite, although in Visual Studio, Atom, or intellij Idea, I tend to just use the built-in SCM tools), but keep refreshed on what you will still need to go back to the command line for as there are some things you’ll just have to.

Thats very cool! I can create an alias for an otherwise lengthy command!

Yep, I’d never remember some of them myself otherwise, despite how often they are used :smiley:

If I want a variation on the alias I can then just peek at its definition for a reference instead, knowing what it usually does, and then run with some tweaked / different parameters.

e.g.

iDog:mirror topdog$ git config -l | grep glog
alias.glog=log --oneline --graph --decorate
iDog:mirror topdog$ git config alias.glog
log --oneline --graph --decorate

Privacy & Terms