DEV Community

Cover image for Do You Still Use Git in the Terminal?

Do You Still Use Git in the Terminal?

Jimmy McBride on September 14, 2024

I’ve been thinking a lot lately about how I use Git in my day-to-day work, and I’ve realized I still default to the terminal for just about everyth...

Displaying a subset of the total comments. Please sign in to view all comments on this post.

Collapse
 
leob profile image
leob

I use a GUI (VSCode) to view git history and diffs (including viewing/resolving merge conflicts), but command line for everything else (commit, push, fetch, merge etc) ... just a GUI for tasks which are easier to do via a GUI, and CLI for the rest :)

Collapse
 
murd0c profile image
murd0c (he/him)

Just like this, I use the VSCode GUI mostly for merge conflicts and see the branch tree in a much clear way, and have it updated with remote pressing just one button.

For the rest I use the CLI, without any aliases because I like it rough (?)

Collapse
 
moraym profile image
Moray Macdonald

Yeah VSCode is so good for resolving conflicts! The CLI is just SO much faster for everything else though.

Collapse
 
jimmymcbride profile image
Jimmy McBride

That side by side comparison is too nice to live without!

Collapse
 
anras573 profile image
Anders Bo Rasmussen

I do exactly the same!
I learned git via the CLI first, and I have tried using GUIs on multiple occasions, but I'm having a hard time figuring out exactly which commands it's going to run, so I prefer to write it myself 😅
But for git history, and diffs, I use GUIs.

Collapse
 
eljayadobe profile image
Eljay-Adobe

I use git on the command line 99% of the time.

For those hard to reach places via command line, I use either Atlassian Sourcetree or git's own gitk.

My former boss speaks very highly of SmartGit. I haven't tried it, though.

Both Xcode and Visual Studio have git integration, but I never use git from those IDEs.

I've heard from my colleagues that use VS Code that the git integration is excellent.

(I was looking forward to Cycligent Git Tool, but appears to have been abandoned years ago. Alas. It was the one Git GUI client I've found that really resonated with me.)

Collapse
 
incominglegend profile image
IncomingLegend • Edited

git in the CLI is slow, inefficient and clunky...
SmartGit is hands down the best crossplatform git GUI I've ever used, too bad they removed the free tier and now its completely payware...
Sourcetree is a bloated mess...
Stay away from Gitkraken, personally I don't trust any app that asks me to login, especially one for git client...
VScode used to have a very popular git extension, that is before it got bought by Gitkraken and now they constantly push you to buy premium or something...
SublimeMerge is a decent git client, could even be considered a good one if it didn't had that annoying popup to buy a license...
Gittyup is free and open source, it doesn't have the most modern UI and it has crashed a few times, but overall it gets the job done, I've been using it ever since I've had to switch from Smartgit...
there are other open source alternatives like Gitnuro which has a modern look but lacks functionality and its development is probably abandoned...
there's also GitButler, another open source with a modern interface that tries to update the workflow of git with virtual branches or something, and it also generates commit messages with AI, it seemed interesting but it feels like its in alpha and in the end I went back to Gittyup...

Collapse
 
jimmymcbride profile image
Jimmy McBride

I will say, I disagree with your first statement. It works much faster than any GUI for larger operations, and if you power yourself with aliases and functions like in my latest blog post you're really speeding up your workflow in the CLI.

Have you checked out LazyGit yet?

Thread Thread
 
incominglegend profile image
IncomingLegend

I haven't checked it out yet so I don't know what to say about that approach, in general I'm a bit shy of using the terminal so I just prefer clicking on stuff, also having the ability to see a side-by-side code diff is another personal preference

Thread Thread
 
jimmymcbride profile image
Jimmy McBride

Side by sides are a very nice quality of life feature!

Tools where you can click around are nice, but they're just doing all the commands under the hood for you. So if you're doing some heavy lifting, since the GUI adds a layer of abstraction, certain big operations can take much longer 7-10 minutes in some cases vs 10 seconds or less in terminal. But hey, ain't nothing wrong with a little coffee break now and again!

If you're a little terminal shy, I'd recommend you to follow my channel here. I try and do my best to demystify the terminal and make it approachable for everyone :)

Collapse
 
godwinkachi profile image
Godwin 'Kachi

Is gitk available on Linux as a standalone app?

I've not heard of it before though, might want to try it out.

Collapse
 
drazenbebic profile image
Drazen Bebic • Edited

I mostly use the GitHub Desktop app on Linux/Mac. The thing does have its limits though, so I do have to switch to the terminal every now and then.

I love the GitHub Integration. If my branch is related to a PR, I can see the status of the PR and know out of the desktop app if there's a problem with it or not.

Collapse
 
jimmymcbride profile image
Jimmy McBride

What editor do you use mostly?

Collapse
 
drazenbebic profile image
Drazen Bebic

I use JetBrains WebStorm mostly. I know they have an amazing Git / VCS integration, but I got used so much to the GitHub Desktop app. I've been playfully mocked by some of my colleagues for being probably the sole developer in our company who uses the Desktop app :D

But like I said - I simply got used to it.

Thread Thread
 
jimmymcbride profile image
Jimmy McBride

We all fall into ways. I would encourage you to play around and learn Idea VCS. It's literally better than everything else. I think you'll find the swap easier than you think!

Thread Thread
 
drazenbebic profile image
Drazen Bebic

The only beef I have with GitHub Desktop is that I only can have one stash active in the UI. I'll try it out and see how it works! The good part is - I have used it to some extent already. I know that changing branches also kind of restores the branch's "workspace", which is a nice feature. This of course gets lost if you change the branch from an outside source.

Thread Thread
 
jimmymcbride profile image
Jimmy McBride

One feature that's pretty nice is you can create different groups for your commits. So sometimes code bases suck and you need to have changes to make things work and not want to push them up. So you can create a group called "don't commit" and move in the files you don't want to commit. then you can have them seperate from all your other changes making it really easy not to accidently push changes you don't want to commit.

The merge conflict editor and diff tool are out of this work imo too. :)

Collapse
 
tbroyer profile image
Thomas Broyer

I use a bit of many things:

  • blame in the IDE (but also sometimes on the command line)
  • gitk most of the times I want/need to look at the history, and git citool (from git-gui) to stage changes and commit
  • git mergetool with Meld to resolve conflicts
  • the command line for everything else (push, pull, rebase, stash, etc.), including using VIM to edit interactive rebase actions or reword commits
Collapse
 
danish profile image
Danish

I think it varies person to person.

Collapse
 
jimmymcbride profile image
Jimmy McBride

Most def does! However, I've definitely seen some trends on this thread. I think the most common answer I've read so far is, "Yes, I use the terminal for most things but I use VSCode or Idea VCS to handles conflicts and diffs, since the GUI makes those more easily readable with the side by side comparisons"

Collapse
 
fyliu profile image
fyliu • Edited

I use the command line, gitk, and lazygit for their respective strengths.

Lazygit can do things like move a commit back in history, which is just a little easier than command line interactive rebase. It can split up an old commit “in place”, which is also an interactive rebase which contains more steps. It can edit commit messages in old commits, which is helpful when you’re the maintainer of a code base with commit message standards. Basically, I use it to do commit cleanup before and after the pull requests. It’s very helpful for rebasing and conflict resolution too, where it shows you what commit you’re currently merging and which files are in conflict. And it allows you to view the conflicts and open an editor to work on that file. After you fix and save all the conflicts, it will continue merging the next commit until done.

Gitk is useful for its lazy graphical UI updating. When I press F5, it refreshes the branch and tag states but still keeps the old refs. So if I made a mistake in the current session, I can just hard rebase back to the previous history. Lazygit will prune the old refs from the view aggressively.

The command line is good for git status and quick commits, as well as times when you want to pass in —no-verify or other flags.

I used to use tig (git spelled backwards). It’s now replaced largely by lazygit except for the use of git blame. It can traverse history to find who really created the line, even after it’s been reformatted by other people. It’s not automated but the tool makes it easier.

Collapse
 
sheppy profile image
Sheppy

I use the git provided by VSCode and git graph to have a clear visual.

I'm the lazy person that do not like to remember git command and prioritize speed/ minimal steps or keystroke to achieve what I needed to, most of the time when I work with build-in git it's usually the case of me waiting for tasks to finish, instead of tasks waiting for me to finish typing.

I love the little time where I can squeeze in a little bit of stuff.

Collapse
 
matthewpersico profile image
Matthew O. Persico

GitHub for PRs. git CLI for everything else. However, like just about everyone else, I have my own wrappers and environment based on a separate branch for each development project or production triage event, a work tree for each branch and a framework that keeps track of it all. For the interested see my ‘personal’ repo under ‘matthewpersico’ at github.

Collapse
 
matthewpersico profile image
Matthew O. Persico • Edited

And emacs is my IDE😉

Collapse
 
jimmymcbride profile image
Jimmy McBride

OMG YOU DON'T USE VIM?!?!?! Haha jk, even Neovim is trying to pull a lot of things from emacs. Emacs can technically do more than you can in Vim or Neovim. I've tried SpaceMacs before and really liked it!

Collapse
 
jimmymcbride profile image
Jimmy McBride

Thanks for sharing! 🔥

Collapse
 
thenickest profile image
TheNickest

I must admit it was a small bouquet I used, a combination of the terminal, vscode extension and GitHub Desktop. Some steps along the way just seemed more comfortable here and others there. However, for anything complex it was definitely the cli.

Collapse
 
mellen profile image
Matt Ellen-Tsivintzeli

I use magit, the emacs package, most of the time. One step up from the command line.

I do use the command line when there's nothing to edit.

Collapse
 
docbok profile image
Mark David Robert McDonagh

For personal projects I generally use Git For Windows as it usually suits my needs. I only use terminals at work where we need specific flows/rebases and it's important that other developers see the flow they expect.

Collapse
 
syedrakib profile image
Rakib Al Hasan • Edited

I moved away from the CLI and use GUI tools now.

I started off with SourceTree by Atlassian. It was great. But it was a super memory hogger and CPU hogger.

Then I found GitKraken. It was cross platform - supported in Windows, Mac, Linux. But somehow the UI didn't quite cut it for me # felt clunky and slow in rendering all UI components.

Then I found Fork and been madly loving it since 2019. Very feature rich. Does not hurt CPU/Memory. The UI feels snappy and it just works. Their team is also pushing out new features and bugfixes quite fast compared to other publishers. Only downside, is it is only supported in Windows & Mac. So if you're using Linux/Ubuntu, this is not for you. But i have been a super fan of it on MacOS ever since - and later learned that many of my colleagues switched to it as well after they saw me juggling with it.

The support for Git in VSCode works for some. But to me, using it feels more like a second-class citizen - an after thought experience - because it tries to fit itself within the UI framework of what was originally designed for VSCode. An advantage of it is that it's free. But if you have the licensing budget, go for a tool which is a first-class citizen and purpose-built specifically for the job of being a git UI.

Collapse
 
jimmymcbride profile image
Jimmy McBride

I think Fork is the second favorite tool that's been suggested! (That I didn't know about before) This seems really cool. The first for me is LazyGit because I'm a terminal junky XD But I think I will be suggesting Fork to plenty of people moving forward :)

Collapse
 
ingosteinke profile image
Ingo Steinke, web developer • Edited

Tools or CLI? It doesn't matter that much in my opinion. The basic advantages and challenges stay the same (merge/rebase conflicts, unexpected "detached head" out of sync states), and why isn't anybody mentioning the elephant in the room? GitHub / GitLab or whatever central authoritative hub repository brings back many of the problems we had when using SVN, and why is GitHub so prone to time out over slow networks? They really introduce an unnecessary single point of failure to what was designed as a robust decentral successor to SVN.

Collapse
 
jimmymcbride profile image
Jimmy McBride

GitHub has quite a few problems. It's so trendy. I prefer GitLab personally.

Collapse
 
moopet profile image
Ben Sinclair

Still?

I never stopped!

I really struggle with GUIs. There are only a few applications where I've put in enough hours to find them comfortable.

Collapse
 
jimmymcbride profile image
Jimmy McBride

I feel this way too. Even with databases. I learned the how to check/change things from CLI and everyone was like, "you should use this PSQL GUI". Then I open up the GUI and I'm like, "How do I do the things I already know how to do???" Lol

Collapse
 
manchuck profile image
Chuck Reeves

I've always used git in the terminal. I was burned a while ago with a desktop app that completely borked the repo. It destroyed the ref log, and all my work was gone. Because of that I stay in the terminal

Collapse
 
jimmymcbride profile image
Jimmy McBride

Wow! That'd keep me in the terminal too!

Collapse
 
sreno77 profile image
Scott Reno

Yes and no... I used git inside of PhpStorm for work and in the CLI for my personal projects. It's easier to use in a GUI but forcing myself to do it manually sometimes ensures that I remember the commands and know how it works.

Collapse
 
jimmymcbride profile image
Jimmy McBride

IDEA VCS is 🔥 Big things are faster in terminal, but if you do those big operations with a GUI you can take a coffee break XD

Collapse
 
masudalimrancasual profile image
Masud Al Imran

I think I am just so used to using GIT in the terminal that I almost unconsciously use it there. VSCode's Source Control tab has some nice and welcome feature, but as I said kinda got used to the terminal. Also, when working on remote servers you don't have the GUI option anyways. So, terminal is go to for me.

Collapse
 
spqrbob profile image
Bob McCann

GUI tools are nice for visualization, but you can really get yourself twisted up in the axles by pressing buttons for git functionalities you don't truly understand.

The CLI requires a certain level of proper syntax/relevant flags knowledge which act as a set of safety rails preventing a rank neophyte from force-pushing an ill-advised rebase they just initiated by face-rolling the keyboard a moment ago.

However, beware the junior dev with just enough CLI knowledge to be truly dangerous!

Collapse
 
habutre profile image
Rogério Ramos • Edited

I have tried GUI like git tower and intellij plugin, but never get used to it. The git cli give me control and confidence about what I am doing, I have no clue how to manage a rebase -i using GUI

So I’m happier and more productive on command line

EDIT: typos everywhere 🤦‍♂️

Collapse
 
zachbryant profile image
Zach • Edited

Vscode works fine for git, but it kinda sucks. The only way it's tolerable is with gitlens. But lately I find that vscode's git UI is unbearably slow. Often it doesn't even update with changes until I click refresh. Git over terminal is the only true reliable way

Collapse
 
jimmymcbride profile image
Jimmy McBride

Try LazyGit! Looks cool :) Idea has the best vcs imo

Collapse
 
strandloper profile image
Steve Crane • Edited

I use the command line along with gitui a text-based UI that runs in my terminal. I use that for most simple things like staging, committing, pushing and viewing logs. It lets me save keystrokes without having to go with a full GUI client as I find them overwhelmingly complex. For more complex things like rebasing, cherry-picking, etc. I use the command line. I keep two Powershell windows open in my Windows Terminal, both targeting my repo folder. One has gitui running and the other for straight command line Git. I have POSHGit installed and that provides some assistance like tab completion.

Collapse
 
wgdavies profile image
WG Davies

I think Git integration in GUI/IDEs is great and can even be handy for shortening the distance to good commits and playing nice with others. However, if you are in a position of doing any kind of build management, integrations, deployments, managing CI/CD, &c &c &c, having a really solid handle on Git is essential (assuming that's your VCS, of course!). That doesn't necessarily require the CLI, but keeping those manpages handy certainly does keep the options in mind for the inevitable code untangling that those disciplines regularly encounter! In my own experience, working with Git primarily or exclusively from the command line drastically shortens the distance to automated solutions and a faster pipeline!

Collapse
 
jimmymcbride profile image
Jimmy McBride

Yeah! When the IDE i'm using has a nice tool to compare conflicts and diffs that could be nice! But for all the other operations, I'm in the terminal. Thinking of checking out LazyGit for comparisons when I'm working in Neovim.

Collapse
 
odalet profile image
odalet

I mainly code on windows and use a very specific workflow.
I always clone on the command line, but that's pretty much it.
I nearly always use TortoiseGit to commit and push.
And I use Fork (a wonderful gui for wi'dows and mac, but sadly not linux) for everything else.
I know it's kind of weird, but this is how I'm productive with git!

Collapse
 
aleixvilaseca profile image
aleixvilaseca

In my case, the entire team uses gitkraken, except for me who still uses the terminal. I have Gitlens configured in VS code that belongs to gitkraken but I don't use it. I've always felt more comfortable working with commands through the terminal. I simply find it easier to understand and organize my ideas and actions. Many times, using applications with GUI I end up getting lost between options and tabs. It's a bummer for me

Collapse
 
the_autistic_programmer profile image
Thomas

Resolving merge conflicts and if I only want to commit part of a file, then intellij still saves the day. Those probably can be resolved with better workflow and smaller commits.
But otherwise, nothing beats the speed of command line. It never lacks.

Collapse
 
reza profile image
Reza Majidi

I was using the terminal for a good amount of time but realized the GUI works better for me in most cases and the reason is I want to closely monitor my code and the changes that I've made and with GUI tools, there is better code readability. (diffs)

But for normal and common actions, I still use terminal and I guess this hybrid combination is the best way for me.

Collapse
 
jimmymcbride profile image
Jimmy McBride

This is the most common response for sure! I have a hybrid approach as well. As long as there's something to get a nice view of conflicts and diffs I'm set!

Collapse
 
sylvaingml profile image
Sylvain Gamel

Yes I do. Most of the time. Why?

I’m far to be an expert of Git command, and CLI is a nice way to improve and learn daily.

I use some text expansion macro to build branch names from bug id.
So it’s often faster for me to just type « gco -b ,/bug » and boom I get a new branch and can commit my fix.

I tend to work mostly between IntelliJ and VS Code. So I do not want to depend on a specific IDE integration.
I tend to also use Git Tortoise on Windows and Source Tree on my Mac. Just because I’m fine with them

There a lot of value to diversify the ways you use a tool. Don’t put yourself in silos.

Collapse
 
jimmymcbride profile image
Jimmy McBride

Jetbrains is my favorite git GUI ever. They should honestly make their own stand alone git client and they'd crush the competition imo

Collapse
 
inthevortex profile image
Angsuman Ray

Totally agreed. They have the best set of predefined commands (until I came across Lazygit). The 3 way diff merge is the best and it was there from a time when no one was providing such an easy merge view. I old stopped using jetbrains because of the heavy resource usage on systems.

Thread Thread
 
jimmymcbride profile image
Jimmy McBride

I've been wanting a git tool that does 3 collum conflicts like the other tools. Can't wait to try it!

Collapse
 
mudittiwari2000 profile image
Mudit Tiwari

gcb is even shorter for "gco -b" if you're using the git plugin for oh-my-zsh.

Collapse
 
jimmymcbride profile image
Jimmy McBride

oh-my-zsh is 🐐

Collapse
 
pinotattari profile image
Riccardo Bernardini

Most of the time I use the CLI: it is simple (once you learn it, but I did), fast, you can get old commands with Ctrl-R, and so on and so forth. I guess more or less everyone here knows the advantages of CLI.

I must also say that usually I do not feel the necessity of something graphical; however, every now and the the necessity arises (for example, to have an overview of the "history" of the current branch) and then I typically use gitk which is enough for my needs. Every now and then I tried other tools, but I do not feel the need to replace gitk.

Collapse
 
jimmymcbride profile image
Jimmy McBride

There are def some niche cases when a GUI is nice. I love those side by side comparisons!

Collapse
 
karlkras profile image
Karl Krasnowsky • Edited

gitbash (on windows) or simply git cli on Linux or nothing!
IDE/OS agnostic.

Oh, well, not quite I guess. I'll use intellij's merge tools for performing merge conflict tasks and sometimes for diffing file versions, but for the most part the CLI.

Collapse
 
mistval profile image
Randall

I use a GUI for certain things, but for the basic workflow of fetching, pulling, rebasing, and committing, I use the terminal. I just use whichever tool I feel is most efficient.

For viewing commit history and diffs, I usually prefer to go online to Github or Gitlab and look there.

When I have a ton of old branches lying around and want to figure out which ones I don't need anymore and delete them, I like to use the VS Code GUI for that.

Collapse
 
georgehossa profile image
Jorge Ossa

I use LazyGit in the terminal with LazyVim

Collapse
 
jimmymcbride profile image
Jimmy McBride

I love the LazyStack!

Collapse
 
canro91 profile image
Cesar Aguirre

Yes! "This is the way!"

Collapse
 
jimmymcbride profile image
Jimmy McBride

😎

Collapse
 
jperna7254 profile image
Jeremy Perna

I use the VS code git tab for things like controlling which file changes are included in a commit and adding a message to the commit. But i still use the terminal for switching between branches and creating branches and cherry picking commits and stashing changes and viewing the git history logs.

Collapse
 
j471n profile image
Jatin Sharma

VS Code UI generally, Sometimes I use terminal also cause it's fun. 😅

Collapse
 
a_k_08eb8b7b3882e737eebf5 profile image
A K • Edited

Git Extensions is one love. Especially for repo and team review with kdiff3 and difftastic integration.
Unfortunately there is no version on Linux...

Collapse
 
jimmymcbride profile image
Jimmy McBride

😭 Looks like LazyGit is pretty 🔥 though!

Collapse
 
madhuri_kotla_5ae5d379dec profile image
madhuri kotla

I think Intellij is great, you don't need to type git commands, can use ui features for almost all commands,for example ctrl+k for commit, you can see text box for the commit message

Collapse
 
robertkraig profile image
Robert Kraig

I use intelij webstorm for 3 way merge during conflicts. Outside of that, always git cli, with delta-diff.

Collapse
 
martinbaun profile image
Martin Baun

Being familiar with the terminal is a skill you will appreciate eventually.

Collapse
 
jimmymcbride profile image
Jimmy McBride

💯

Collapse
 
aswzen profile image
Agus Sigit Wisnubroto

have been 7 years we are forced to use gitk.. since company is not allowing to install any additional "bloating software".. and its lightweight though

Collapse
 
jimmymcbride profile image
Jimmy McBride

Are they a Linux company? Or government?

Collapse
 
steve_cooper_465bc357c90e profile image
Steve Cooper

I use VSCode for commits because I'm editing anyways. It's just a couple of extra mouse clicks.

I use the CLI for most everything else.

I do a bit of managing on the GitHub website.

Collapse
 
databliss profile image
DataBliss

Git documentation is based on the terminal, so that’s what I use.

Collapse
 
pwillard profile image
Pete Willard

Agree with others here. I still use GIT 99% from the command line even though I might occasionally allow VSCODE to manage my updates.

Collapse
 
remejuan profile image
Reme Le Hane

It’s a mix, I use the UI for committing and diffs, but terminal for most everything else.

Collapse
 
jimmymcbride profile image
Jimmy McBride

I think this is the most common answer for sure!

Collapse
 
kochiyama profile image
Marcelo Haruo Kochiyama

I use Lazygit, is a TUI for git that enables me to use git without going out of nvim. It has a cool visual cherry pick that is nice.

Collapse
 
jimmymcbride profile image
Jimmy McBride

Am about to add this to my Neovim flow :)

Collapse
 
somerussianguy profile image
Const

I use Fork. Because another big clients is just a trash on js ui frameworks. They use to many pc resourses

Collapse
 
jimmymcbride profile image
Jimmy McBride

Fork looks really cool!

Collapse
 
andorei profile image
Andrey_vdl

I always liked to use the terminal, there's an amount of dopamine gained for knowing the git subcommands and resolving all problems without the clicking in a GUI.

Collapse
 
jimmymcbride profile image
Jimmy McBride

I agree! 💯

Collapse
 
ananyapaw profile image
Ananya Paw 🐾

yep

Collapse
 
jeremymoorecom profile image
Jeremy Moore

Cli for most commands. Sometimes I might use a GUI to view conflicts.

Collapse
 
jimmymcbride profile image
Jimmy McBride

Same! 💯

Collapse
 
markfriedman profile image
mark-friedman

I mostly use GitHub Desktop, and a little bit of Magit. I'm also interested in what the folks at GitButler are doing.

Collapse
 
samos123 profile image
Sam Stoelinga

Yes, I still use git in the terminal! It just makes me more confident to not mess things up.

The only thing I use VS Code for is resolving merge conflicts.

Collapse
 
coborski profile image
Catherine Oborski

Terminal! It's probably just because I haven't taken the time to properly learn them, but whenever I use a gui I always end up getting frustrated by some unexpected behavior.

Collapse
 
perisicnikola37 profile image
Nikola Perišić

I only use git in terminal

Collapse
 
bellini79 profile image
Giacomo Bellini

I've never used git from the command line, but I've also always worked in small teams of two/three developers and our repository has never been much more than a backup with benefits.

Collapse
 
jimmymcbride profile image
Jimmy McBride

Yeah, on big projects when you do something crazy heavy once in a blue moon, the GUI can take several minutes where as the command line would do the same in several seconds. But hey, good excuse for a coffee break! ;)

Collapse
 
antoniodemax profile image
Anthony Peter

yes i normally use it in the vs code terminal

Collapse
 
kononenkoam profile image
Anton Kononenko

I use mostly terminal, and if I need to view branches/changes with it content I use gitk.

Probably one more case of using UI is git blame, this I run from IDE.

Collapse
 
workingwithaitools profile image
Bryce

Thanks. Git Kraken looks cool.

Collapse
 
dreigenannt profile image
Melinda Green

Command line all day.

That said, I learned programming on a SPARC station, so......

Collapse
 
steveblue profile image
Stephen Belovarich • Edited

Most of the time I spend with git is in a Terminal but diffing and staging mostly in the IDE. VS Code is great for merge conflicts too, but even with the good UX I feel like GUI haven't gotten it perfect yet and most commands can be issued in the Terminal. tig is a good upgrade for git in the Terminal too.

Collapse
 
jimmymcbride profile image
Jimmy McBride

Yeah, merge conflicts and comparing digs can be really nice in a GUI. I think Jetbrains has the best GUI git integration ever imo. VS Code seems very solid too!

Collapse
 
inthevortex profile image
Angsuman Ray

If you don't want to leave the terminal, I would suggest trying the merge conflict resolution of Lazygit. I have started liking it but I still feel during complex merges the 3 way diff of jetbrains is unbeatable.

Thread Thread
 
jimmymcbride profile image
Jimmy McBride

This is 10000% on my todo list!

Thread Thread
 
steveblue profile image
Stephen Belovarich

Lazygit and Tig seem to have some overlap, but it's possible Lazygit could be more intuitive. Giving it a look. Thank you!

Collapse
 
perseque profile image
Perseque

For me personally, using git in the terminal is a 100% better than using vscode, vscode offers only limited utilities than using git in the terminal.

And for those beginners who are reading this article, I highly recommend trying Git Exercises for those who are starting out.

Collapse
 
jimmymcbride profile image
Jimmy McBride

Wow! Super cool resource! Will share this with my friends :)

Collapse
 
runecreed profile image
Runecreed

I use my IDE to handle git related stuff. intellij has a good integration with git log, rebase, commit, stash, revert etc.
No reason to bother with knowing commands by heart, I'm using hotkeys to switch and compare branches as needed.

Collapse
 
jimmymcbride profile image
Jimmy McBride

Idea has best git GUI imo!

Collapse
 
goofyfoot profile image
William Rutkowski

on Windows I use GitHub Desktop app it is faster then what they embedded in VS Code.
Your commits and pushes transfer much faster and it has direct linking to Github, VS Code or File Explorer, at a click away.

I also still use Notepad++ when I am pondering something deep. I use the terminal to run the server and pass to Github thru the Desktop app.

Collapse
 
drazenbebic profile image
Drazen Bebic

FYI: GitHub Desktop works really well both on Linux and Mac! Personally, I have used it on Ubuntu because there is an easy-to-install .deb package available. For Mac you just download and install the .dmg file.

Collapse
 
goofyfoot profile image
William Rutkowski • Edited

I have Ubuntu-22.40.xx-LTS on here thru WSL and have had Notepad++ installed / added it to the variables beside nano.
That was awhile back when you could only embed Firefox for a browser. Plus jump thru hoops to configure a GUI and file system - explorer based root directory.

I have used it on Ubuntu because there is an easy-to-install .deb package available.

<
I will look for this package as I am getting back into MongoDB and like to use it for the web backend and node / express server stuff. As well as VS Codes terminal or Windows cmd. I was bottle feed on Windows 7 .... that was my first ever intro to a computer. I have only used Windows machines for coding and not developed anything on Mac or I O/S anything.

Back when Swift was just introduced I was learning Unity and Android / Gradle. Just because it was like $60 a month to get permission basicly to build for Mac - I O/S.
That is what I was told ... $60 a month to Publish your code and you need Pro version ANYTHING they make to develop or preview your code. That was 2015 - 2016~ish ....... way back then!!

Regardless if you were certified dev's or first semester. Google is $25 for a one time developers registration free to Play Store. Android Studio is free and has all build tools the way Visual Studio Community Edition does.

I am only focusing on browser - HTML - CSS - JavaScript as it is all you need to become cross-platform ready.
Learn Docker and enjoy writting code today. Instead of what you had to plow thru 10 years ago to get a page to mobile or desktop. What you don't have to do anymore, many people today have no clue. I got my first computer in 2012 and was playing with dev tools console by 2013.
What they had to work with was called bower and brocolli ..as package managers and basic version controlling. Gulp and Grunt were just introduced people still though Ruby was the only was out. And jQuery and PHP were NEEDED to get hired.

As Angular and React were designs stills and Gadspy and Webpack were being rolled out. NODE and npm were being built as well as bable for future es6 ... From a computer science eyeball the modern web landscape has evolved drasticlly. From 2000 with Push Notifactions and Paggers to the 2010 APP for that explosion. To say the least .........

I grew up when they just started allowing calculators in the class rooms for tests and finals. We had a bunch of "OLDSCHOOL" teachers that made you take out the batteries if you put it on the desk!! So I learned it is bested to focus on two ways to do something. In case one fails !!

Thread Thread
 
drazenbebic profile image
Drazen Bebic

Seems I lied a bit about the .deb package, sorry I misremembered it :D

There is a package feed you add, and then simply run apt install github-desktop. Here's the docs:

github.com/shiftkey/desktop?tab=re...

I have only used Windows machines for coding and not developed anything on Mac or I O/S anything.

Same here for a long time, but then the last two years I got a new job where they were strongly suggesting I take a MacBook because it will be easier. It's a great product and I enjoy it a lot. I can definitely see the appeal in it.

Then I also dual-booted Ubuntu on my existing Windows PC and that's where I do most of my work now when I work from home. You don't have to go all-in on the Linux-ness and build your own OS or try arch-linux (even though I want to do that too at some point). Ubuntu gives a great out-of-the-box experience and the last few years has been very stable and consistent in many aspects. I can't recommend it enough.

From a computer science eyeball the modern web landscape has evolved drasticlly. From 2000 with Push Notifactions and Paggers to the 2010 APP for that explosion. To say the least .........

I know what you mean about the industry changing rapidly. I've been a developer for over a decade now. I remember OC'ing my Pentium 2 processor from 200 to 300 MHz and frying it in the process. The first OS I used was Windows 3.1. Now I have a Watch on my wrist which is more powerful than my fried Pentium 2.

We had a bunch of "OLDSCHOOL" teachers that made you take out the batteries if you put it on the desk!!

They never let you do it the easy way. As someone who has trained a few developers I can see why that's important. You can of course complete the task faster, but you're missing out on the underlying mechanics of things.

Thread Thread
 
goofyfoot profile image
William Rutkowski

I was learning Drafting and Mechanical Drawing in 1978 from a teacher who was one of the draftsmen who layout the B-17s for Boeing in WWII .....

In 2013 -2014 I was using NERBS in RHINO design software and SketchUp & Blender as substitutudes for CAD and AutoDesk - AutoCAD .........

I have lived and loved in both analog and digital worlds and for all those who were born after Y2K. It was said to be the end of the world as we know it !!!

...... as 2020 and life after Trump have shown it just took 20 ++ years to take effect!! ..... Peace and enjoy the ride I was chasing the Web from 2013 till 2019.

I am glad I jumped onboard and went the route I did. I was told learn React for one year and half and thats all you needed or learn Wordpress & Bootstrapes.

I love to learn and enjoy the struggles it brings -- LIVING / GROWING from 1964 to 1999 and no internet and 4 to 6 weeks for delivery was spot-on!! We have been given a golden advantage over many today. And we Gen-X'ers are gone ..OH BOY !!

... most don't exert anything extra to anything. Social Status and a fake profile or brand and more income then your neighbors is the chase.

Thread Thread
 
jimmymcbride profile image
Jimmy McBride

Rolling up your sleeves and getting dirty has so much value. Def a quality that seems to be loosing on the most recent generations. But I have hope things will start to turn around. :)

Collapse
 
oaklandgit profile image
Larry Stone

I do. Even though I spend most of my time in VS Code, I eschew its terminal and git integration for a dedicated terminal (iTerm). I find it much faster to cmd-tab (I'm on a Mac) to switch to my terminal and issue commands.

Collapse
 
dtsnyder profile image
Drew Snyder • Edited

Control + ~ puts you directly into the VSC terminal when your current context is VSC. Bonus, Command + ~ switches between instances of the same application, these commands are very helpful when you have two or three instances of VSC open all with their own terminal.

Collapse
 
jimmymcbride profile image
Jimmy McBride

Thanks for the short cuts! Super useful :)

Collapse
 
msamgan profile image
Mohammed Samgan Khan • Edited

I added this to by bashrc a long time ago. since then I have been using them generally. Might be useful....

function commit() {
    git add . && git commit -m "$1" && git push
}

function nbranch() {
    git checkout -b "$1" && git push --set-upstream origin "$1"
}

function opull() {
    git pull origin "$1" && git push
}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
jimmymcbride profile image
Jimmy McBride

Love these! Bash functions are so great when doing stuff like that from the command line!

Collapse
 
eucaue profile image
Caue Souza

Yes, I basically just use Git in the terminal, and on some occasions, I use gitu tui.

To help me with Git in the terminal, I have some aliases, and I use meteor to help with commits! :)

Collapse
 
jimmymcbride profile image
Jimmy McBride

Wow, nice! I've been looking for some good terminal tools for git! XD I'm thinking about writing an intermediate to advance git blog, and I'd like to tie in a bash article after it showing off some fun Git things you can do. But I was wondering if people even do stuff in the terminal like that.

From all the responses on this post, it seems like it's a good idea to go ahead and write them up! Haha

Collapse
 
eucaue profile image
Caue Souza

Yeah, gitu is such a cool tool!
You should totally write that blog post, I’d love to check it out and learn more about Git!

A lot of people work with Git in the terminal, so I’m sure your tips would be super helpful. :)

Go for it! Can’t wait to see what you share. 😊

Thread Thread
 
jimmymcbride profile image
Jimmy McBride

I'll have to check it out! 🙂

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

GUI tools are like drawing things to communicate with other people: Great for when you don't share a common language, or to occasionally illustrate things that are just better understood visually than in text.

But when both parties speak the same language, aka. the git command line, then it is quicker and more effective to just use that as the main form of communication.

I almost exclusively use git from the command line, and when I need some graphic stuff, just opening github/gitlab/forgejo is usually more convenient than having a dedicated local tool for it.

Other than that, I have a vim script to diff a file against its committed version to easily see what I've changed, but that's about it.

Collapse
 
jimmymcbride profile image
Jimmy McBride

I know Jetbrains has a super cool diff feature in there VC. Saved my butt at work a few times!

Collapse
 
kubernetic profile image
BC

Yes and no, but it depends.

I usually use git pull to pull a repo regardless of ide. I sometimes prefer doing commits in the terminal for multi-line commit messages, since VSCode limits my commit length otherwise.

I often use the GUI tools from VSCode for my Git usage, but at times find it helpful to use the cli, and in some cases that's all I have.

I want to setup LazyGit and use that, but haven't looked into it just yet. It looks like an interesting tool.

Collapse
 
timexpeachtree profile image
Timex Peachtree

LazyGit is awesome 💯, it gives you the option to use the git commands you never knew you wanted without having to memorize them commands and parameters.

For beginners it makes git lot easier and allows you to know what git commands it executed, has increased my knowledge of Git more than when I was using direct git command line only.

Collapse
 
jimmymcbride profile image
Jimmy McBride

I plan on checking out LazyGit soon!

Collapse
 
jimmymcbride profile image
Jimmy McBride

I think having relatively short commits is best practice. But they still shouldn't force it down your throat

Collapse
 
myjsalterego profile image
Aleksey Litvinov

Terminal is very flexible and customisable and suitable not only for git, but for many more things. For example, I use terminal for Git, Code search (find, grep).
GUIs are usually tailored for specific use case and might be limiting.

Collapse
 
jimmymcbride profile image
Jimmy McBride

I agree! It can be nice for viewing difs and conflicts at times, but most of the time the terminal is fast and easy. Especially when you have your own alias and functions to help speed things up!

Collapse
 
myjsalterego profile image
Aleksey Litvinov

Exactly!

Collapse
 
ashishpshende profile image
Ashish Shende

I used to rely heavily on Git commands before switching to Visual Studio Code, except when working with Xcode. Now, I've fully transitioned to using the UI for most operations. The UI provides a clearer view, especially when resolving merge conflicts. However, I still prefer using Git commands for basic tasks. For example, I continue to use the git clone command to clone repositories, helping me stay familiar with Git commands.

Collapse
 
jimmymcbride profile image
Jimmy McBride

This is a super common approach. Conflicts and diffs it's so nice to have that side by side view! I've experienced and others as well, when dealing with a massive amount of changes, the GUI's can get pretty slow compared to the terminal. But for most basic operations, if it's build into the IDE, it's pretty convenient!

Collapse
 
davvolun profile image
Dav

That's funny, we were just taking about this. "Annotate" in VS on our "worst" file was minutes, for me about 7 minutes, to complete. Command line git blame was 10 seconds, maybe. Probably less. I don't know what VS is doing that took it so long with this admittedly desperately in need of refactor file, but something is off.

Collapse
 
jimmymcbride profile image
Jimmy McBride

That's always the trade off when relying on tools that abstract thing away.

Collapse
 
ypismerov profile image
Yuri Pismerov • Edited

I have always been amused with some of my teammates using VS Code to search for specific patterns in their code. Why not use grep -r in your cloned project? And I keep saying: “You guys tend to do simple things using least efficient methods”

Collapse
 
jimmymcbride profile image
Jimmy McBride

I'm a terminal junkie myself, but so many people are afraid of it! I try and write blog posts to help people become less afraid.

Collapse
 
natescode profile image
Nathan Hedglin

I almost always use the CLI. I have plenty of custom git aliases too.

Aliases help me squash, save, making features branches and even clean up my local branches that have been merged.

I use VIM bindings so my fingers rarely leave the keyboard anyways. A quick CTRL+SHIFT+T and git wip automatically saves my progress.

Collapse
 
jimmymcbride profile image
Jimmy McBride

I love VIM :) Stared this gist. Will check out adding some of these to my list of aliases :)

Collapse
 
ddfridley profile image
David

I maintain an open source project (github.com/enciv) I use git on the command line 100% of the time because it's too hard to explain to new devs how to do things with a gui. Part of making open source work is having documentation the makes it easy to get started and contribute. Documenting guis is hard to do and hard to follow. Also, after your fingers know the commands it's way faster than doing it through a gui. But I do use VSC and a plugin for doing different between branches.

Collapse
 
jimmymcbride profile image
Jimmy McBride

I agree with this. Anytime I help someone with, the terminal is universal!

Collapse
 
faisalkhan4k profile image
Mohammed Faisal Khan

I use git mostly on the command line.
This may be due to my lack of knowledge of other git commads.
I mostly use the commands such as clone, push, pull, branch, add, commit, stash.
To be honest till now in my learning phase i never had an instance where i required more than the above cmds.

Collapse
 
mahendranv profile image
Mahendran • Edited

I prefer to use both terminal and GUI. The usecase defines the tool. Basically for any preview related usecase, I resort to UI.

Before commit, I review the changes in Sublime Merge. And remove the debug logs using unstage line feature.

For viewing file history along with preview, Sublime Merge serves the purpose.

For all the other cases, I'd use terminal and use in combination with scripts or git aliases.

Collapse
 
jimmymcbride profile image
Jimmy McBride

Sublime was my first editor :)

Collapse
 
inthevortex profile image
Angsuman Ray

I've been using Git mostly from the terminal, most of the time. When I was using windows, I used to use a tool called Fork, very neat UI and at that time VS code internal git was quite bad. But then I kept going back to the terminal, I've now settled on Lazygit, it's a TUI, so no more extra heavy application running that goggles resources, very powerful and precise, has a lot of functionality and makes tedious commands easier like moving a commit 2 places ahead because improper rebase created a merge commit, or things like updating an old commit with extra code easily with 2 key combination, etc. After finding this, I've been using it for more than a year now.

Collapse
 
timexpeachtree profile image
Timex Peachtree

Now I use the awesome LazyGit for accessing git from command-line, works like a charm. (Best for Cross-platform development too👌🏽)

While doing .net based development for apps I use Visual Studio built in Git client.

Also I use Notepad++ built in Git client for browsing source tree when need a particular change history.

Earlier used Git command-line but after Lazy git got lazy.

Collapse
 
jimmymcbride profile image
Jimmy McBride

Been hearing so many good things about LazyGit! I'm going to have to check it out 🙂