DEV Community

Ryan Weaver
Ryan Weaver

Posted on

Where to start with Git?

I don't know much about git and I want to learn more. Over the past 4.5 years, I have used Mercurial for all development projects, using the TortoiseHg Workbench tool. Please help me out here!

  1. Where should I start for learning about git, with coming from a mercurial background?
  2. What GUI tool/tools for git resemble TortoiseHg Workbench?

Top comments (5)

Collapse
 
ahferroin7 profile image
Austin S. Hemmelgarn

Where should I start for learning about git, with coming from a mercurial background?

The official Git tutorial. Either in the console via man gittutorial, or online at git-scm.com/docs/gittutorial.

While this focuses on CLI usage, you really should make sure you understand the CLI usage before you worry about a GUI.

Big things to remember coming from Mercurial:

  • Unlike hg commit, git commit doesn't pull in all the changes in the working directory by default. You have to either use git add to stage specific files to be committed, or use git commit -a to pull in everything. This is annoying at first, but it's really powerful because you can add individual parts of files to a commit independent of any other changes in the file, which makes it much easier to split out a big sweeping set of changes into logically independent commits.
  • git pull is equivalent to running hg pull and then either hg update (if you have no new changes on your local branch relative to upstream) or hg merge (if you do have changes). Use git fetch if you really want to just pull the references without updating local history.
  • Branches are used much more freely in Git than they typically are in Mercurial.

What GUI tool/tools for git resemble TortoiseHg Workbench?

At some point there was a Tortise GUI for Git as well, I'm not sure if it's still around or not.

Officially, current versions of git come with a git gui command and a tool called gitk which provide GUI functionality. You may have to install additional packages for these on Linux systems.

Other popular GUI's include GitKraken, git-cola, SmartGit, and qgit. I can't comment on how well any of them work or not though as I pretty much stick to the CLI interface (I do the same for Mercurial as well though).

Collapse
 
williamlake profile image
William Lake

I've found these resources to be the most helpful when it comes to learning/using git:

I agree with Austin re: getting comfortable with CLI before GUI although that's really your perogative.

Collapse
 
jimpriest profile image
Jim Priest

And this one - when things go bad :)
ohshitgit.com/

Collapse
 
williamlake profile image
William Lake

This is fantastic! Never seen it before. Bookmarked!

Collapse
 
jimpriest profile image
Jim Priest

cli. cli. cli. We just switched from SVN to Git and I encouraged everyone to use cli. Someone pings me a day later with a question and then they mention they are using some Git gui tool. Sigh.

Learn cli. Get a good understanding of how Git works and THEN feel free to use a Gui or whatever.