Forgit and Lazygit. The 2 Git tools to supercharge your git workflow?

Most of us use version control systems (mostly git) for our projects but the git CLI is unproductive. We often need to run multiple commands and got to type more characters.

Well, what if I told you there are tools that can improve this significantly…


This content originally appeared on DEV Community and was authored by Anish De

Most of us use version control systems (mostly git) for our projects but the git CLI is unproductive. We often need to run multiple commands and got to type more characters.

Well, what if I told you there are tools that can improve this significantly. We are going to be looking at 2 tools today, forgit and lazygit. Both of these tools let us do many of our day-to-day git tasks, interactively and come with a LOT of keyboard shortcuts.

Forgit

Forgit, a simple and lightweight wrapper around git commands which uses fzf to provide interactivity to git commands (and some more goodies :D).

For example, this is how the ga (git add equivalent) looks like -

ga command in forgit

YES, that is a diff view!

Oh and it is not limited to just staging files, there are many more interactive commands (each with its own alias :D )

Want to explore all the previous git commits? Run glo -

glo command in forgit

Want to see the list of branches and checkout to the appropriate one? Use gcb -

gcb command in forgit

And there are more! For a full list, you can see the features section in the forgit README

Lazygit

Lazygit on the other hand is a TUI written in Go and is crazy powerful. This is how it looks like -

lazygit tui

Yeah those are a lot of panes indeed. Files can be staged/unstaged easily by pressing Space and pressing c brings up a modal for writing a commit message -

commit modal in lazygit

Once you are done writing the commit message, press Enter and the changes get committed :D

Oh and we can see a log of everything we do as well as any command output -

command log in lazygit

And for all of us who hate using the mouse (although lazygit has mouse support), there are a TON of keyboard shortcuts -

keyboard shortcuts in lazygit

You can see look at some more things it can do (like resolving merge conflicts and interactive rebasing) in the lazygit README.

Conclusion

So, which one should you use? This depends on your use case and how you want to use the tools.

I personally use the git CLI, forgit, lazygit, and the vscode source control panel depending on what I'm doing. I always use lazygit inside neovim but when I am using vscode, it is mostly forgit and the git CLI (I rarely use the source control pane).

Links


This content originally appeared on DEV Community and was authored by Anish De


Print Share Comment Cite Upload Translate Updates
APA

Anish De | Sciencx (2022-07-23T16:42:43+00:00) Forgit and Lazygit. The 2 Git tools to supercharge your git workflow?. Retrieved from https://www.scien.cx/2022/07/23/forgit-and-lazygit-the-2-git-tools-to-supercharge-your-git-workflow/

MLA
" » Forgit and Lazygit. The 2 Git tools to supercharge your git workflow?." Anish De | Sciencx - Saturday July 23, 2022, https://www.scien.cx/2022/07/23/forgit-and-lazygit-the-2-git-tools-to-supercharge-your-git-workflow/
HARVARD
Anish De | Sciencx Saturday July 23, 2022 » Forgit and Lazygit. The 2 Git tools to supercharge your git workflow?., viewed ,<https://www.scien.cx/2022/07/23/forgit-and-lazygit-the-2-git-tools-to-supercharge-your-git-workflow/>
VANCOUVER
Anish De | Sciencx - » Forgit and Lazygit. The 2 Git tools to supercharge your git workflow?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/07/23/forgit-and-lazygit-the-2-git-tools-to-supercharge-your-git-workflow/
CHICAGO
" » Forgit and Lazygit. The 2 Git tools to supercharge your git workflow?." Anish De | Sciencx - Accessed . https://www.scien.cx/2022/07/23/forgit-and-lazygit-the-2-git-tools-to-supercharge-your-git-workflow/
IEEE
" » Forgit and Lazygit. The 2 Git tools to supercharge your git workflow?." Anish De | Sciencx [Online]. Available: https://www.scien.cx/2022/07/23/forgit-and-lazygit-the-2-git-tools-to-supercharge-your-git-workflow/. [Accessed: ]
rf:citation
» Forgit and Lazygit. The 2 Git tools to supercharge your git workflow? | Anish De | Sciencx | https://www.scien.cx/2022/07/23/forgit-and-lazygit-the-2-git-tools-to-supercharge-your-git-workflow/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.