The ULTIMATE Git workflow using Neovim's Fugitive, Telescope & Git-Signs!

  Рет қаралды 56,402

DevOps Toolbox

DevOps Toolbox

Күн бұрын

Git commands and workflow can become SO MUCH better!
Right from you're IDE, without any external tooling, it integrates fully into designing commits, searching code, comparing branches, and more...
Tools in the video:
▶ Fugitive: github.com/tpope/vim-fugitive
▶ Telescope: github.com/nvim-telescope/tel...
▶ Telescope with TJ DeVries (Neovim maintainer and Telescope author!): • Telescope and Nvim 0.5...
▶ Git signs: github.com/lewis6991/gitsigns...
▶ Git signs alternative for Vim / older Neovim versions: github.com/airblade/vim-gitgu...
▶ My Dotfiles: github.com/omerxx/dotfiles
SUPPORT THIS CHANNEL
www.buymeacoffee.com/omerxx
My Favourite Gear!
=======================================
* If you enjoy my content, using the links below can help me with a small commission, thank you!
⌨️ My keyboard is the wonderful HHKB: amzn.to/3HwJG60
🔗 The HHKB is wired with a high quality coiled cable: amzn.to/3DCA87d
⌨️ Backup keyboard (for traveling mainly) - Nuphy Air60: amzn.to/3R3M7jz
🖥️ My ultra wide 49" monitor: amzn.to/3JbVThC
🎙️ Microphone - HyperX Quadcast: amzn.to/3kLcNJR
🦾 Heavy Duty Monitor Arm: amzn.to/3kKp7tS
🖱️ Mouse - MX Master 3: amzn.to/3DiZmaj
Subscribe!
=======================================
Subscribe for more videos like this: www.youtube.com/@devopstoolbo...
My blog: omerxx.com
Dev & Ops tools Telegram channel: t.me/espressops
Chapters:
=======================================
00:00 - Intro
00:22 - Fugitive
00:41 - The :Git command
02:16 - Gvdiff - a comparison tool
03:11 - Gwrite & Gread
03:33 - Git log & blame
04:00 - Git signs additional features
04:40 - Commit!
05:00 - Telescope
06:04 - Vim lua config
06:29 - Full workflow
#neovim #devops #platformengineering #terminal #dev #git #cloud #cli #terminal #dev #ops #ricing #linux #macos #commandline #typing #keyboard
Music:
=======================================
Faithful Mission by Artificial.Music | / artificial-music
Music promoted by www.chosic.com/free-music/all/
Creative Commons CC BY 3.0
creativecommons.org/licenses/...
Sleepless by Purrple Cat
purrplecat.com/
Music promoted by www.chosic.com/free-music/all/
Creative Commons CC BY-SA 3.0
When I Was A Boy by Tokyo Music Walker | / user-356546060
Music promoted by www.chosic.com/free-music/all/
Creative Commons CC BY 3.0
creativecommons.org/licenses/...

Пікірлер: 59
@devopstoolbox
@devopstoolbox Жыл бұрын
Thanks everyone for the feedback! You're input helps me create more content and is the reason I'm doing this in the first place 😃 I'm going to release a separate video on using this sequence to handle git merge conflicts so stay tuned! In the meantime, you're welcome to subscribe: www.youtube.com/@devopstoolbox?sub_confirmation=1 And if you're interested in weekly bytes of tech tools and posts I find around Dev & Ops, you're welcome to join the Telegram channel: t.me/espressops
@sergioquijanorey7426
@sergioquijanorey7426 Жыл бұрын
Awesome video! I prefer to commit certain chunks of code using directly fugitive. For any interested, just open the preview using the = shortcut that is shown in the video, then visually select the chunk of code that you want in the commit and press 's'
@devopstoolbox
@devopstoolbox Жыл бұрын
Nice! Thanks!
@JakeDuthDev
@JakeDuthDev 8 ай бұрын
s is a pneumonic for "stage"
@bridgey2012
@bridgey2012 Жыл бұрын
I've been aware of fugitive for a while but have gotten so used to just using the command line for git that I never bothered with it. Some of these features seem so useful I'm deffo checking it out now, thanks!
@devopstoolbox
@devopstoolbox Жыл бұрын
Totally with you on that, but once I got the hang of it it felt so weird doing any git related outside the IDE. I mean that’s literally where the code is. There’s a middle-way though: Vim is natively integrated with your shell so running anything directly from Vim like "!git status" or "!git diff" makes a lot of sense, if you add aliases to everything you can pretty much create your own plug-able workflow without installing anything external! That said, fugitive is smarter than just plain commands and I find it incredible to integrate :)
@jameswright4732
@jameswright4732 Жыл бұрын
The game changer for me not show in the video is if you hit "dd" on a diff in the Fugitive status, it'll bring up a side-by-side diff that can be used for incremental staging of files. That was the game changer for me.
@devopstoolbox
@devopstoolbox Жыл бұрын
@@jameswright4732 Hey! If I'm not mistaken `dd` is a shortcut for Gdiffsplit, which I've used here a lot. For staging of files, I mainly use the status (:Git) and the use of `-` as I've shown. However, I personally try to avoid staging of files (also doable with :Gwrite) and I try to always add changes using the git signs plugin (or older gitgutter). This way I can control the exact changes added to a certain commit and the context of changes makes more sense in the long run!
@luvvvit
@luvvvit Жыл бұрын
awesome video, I haven't tried fugitive yet, u inspired me to do so, currently I'm using lazygit+toggelterm combo
@devopstoolbox
@devopstoolbox Жыл бұрын
Hey man! Definitely, Lazygit is awesome, I just answered a similar question here - I find having git commands right from the code to be very elegant and supporting my flow. Any other tool that forces my out of it (even git CLI itself) is taking me even if slightly, away from the flow of Vim. Having flowterm is a neat upgrade for my best workflow (so far, at least) is the one in the video :)
@notko8431
@notko8431 Жыл бұрын
nice one man :) helped me get the hang of fugitive more, it's crazy good
@devopstoolbox
@devopstoolbox Жыл бұрын
Yes! So happy to hear, thanks for sharing :)
@annusingh4694
@annusingh4694 Жыл бұрын
Awesome video! Thank you 🎉
@typecraft_dev
@typecraft_dev Жыл бұрын
love fugitive. Great video as always, awesome style!
@devopstoolbox
@devopstoolbox Жыл бұрын
Yay 😁 thanks mate 🙏🏿
@Guilherme-qk9so
@Guilherme-qk9so Жыл бұрын
great video! Thanks! :)
@need4eat
@need4eat Жыл бұрын
Liked before watching. I know it’s going to be awesome ❤
@devopstoolbox
@devopstoolbox Жыл бұрын
This warms my heart! Thank you so much 😀
@sreedev
@sreedev Жыл бұрын
Hey! Thank you for the great video. I just wanted to point out that when you're in a "fugitive git status" buffer, you can just hit "cc" to create commit without typing ":Git commit".
@devopstoolbox
@devopstoolbox Жыл бұрын
Thank you!!
@yash1152
@yash1152 Жыл бұрын
0:17 nice keypress overlays (between left center, and left bottom)
@n0kodoko143
@n0kodoko143 Жыл бұрын
Great share! (Also, cobra is a very cool library. I played with it a few times before, but I def should go back. What cli tool did you build with it (I was some aws docs in the code)?
@devopstoolbox
@devopstoolbox Жыл бұрын
Good catch 😉 This is a project I’ve been working on for a while, it’s supposed to identify an EC2 with a pre-installed SSM agent and add permissions + relevant routing if necessary (for subnets with no internet access) so that any ec2 is accessible with SSM connect and basically gets you SSH with no keys / VPN / bastion involvement!
@inteliconn995
@inteliconn995 Жыл бұрын
Thanks!
@devstefancho
@devstefancho 8 ай бұрын
thx for sharing your workflow, I experience that telescope git_files command is not displaying the staged code on the preview, how do you deal with
@devopstoolbox
@devopstoolbox 8 ай бұрын
Hi! Git files will only show git tracked files. If you have new files not yet staged / committed you won’t be able to see them there. For these, try working with the file picker
@theIbraDev
@theIbraDev 8 ай бұрын
Came back to this video to say thank you, my colleagues think i'm a wizard because of you.
@devopstoolbox
@devopstoolbox 8 ай бұрын
Yeah!! 🫡🫶
@enmanuellagares
@enmanuellagares Жыл бұрын
Hey @DevOps Toolbox, could you show us how you overlap the transparent terminal on top of your video?
@devopstoolbox
@devopstoolbox Жыл бұрын
Hi Emmanuel! I’ve borrowed my style from the amazing Takuya (@devaslife), which was reluctant to share this specifically claiming that’s his unique style and what makes him special (which I agree). So I went on figuring out a way of my own. I feel like sharing what I’m doing would be doing a big disservice to Takuya so I’d rather not do that… I can tell you two things though: 1. You can easily achieve that with two videos layered using your favorite video editor. 2. If you look closely at my first couple of videos I think you’d be able to understand how I’m doing mine 😉 I hope you understand and I’d love to see your stuff when it’s ready! Cheers
@enmanuellagares
@enmanuellagares Жыл бұрын
@@devopstoolbox Thank you for the help! I really like your vibe
@huyvuquoc6575
@huyvuquoc6575 Жыл бұрын
I love your nvim configuration. Can you share your configuration?
@devopstoolbox
@devopstoolbox Жыл бұрын
Hi! My config for vim is on Github at omerxx/dotfiles. Under .config/nvim you can find most of it, but I’ll be sure to push an updated version this evening! If you have any questions feel free to ask
@admiralrodney3818
@admiralrodney3818 Жыл бұрын
Fugitive is awesome if you use it correctly Btw, how did you maximize the window when you split a buffer?
@devopstoolbox
@devopstoolbox Жыл бұрын
Hey! Yes it is :) So the actual term is splitting a window, and then you can show different (or the same) buffer in the splits. So when you split a window you can use the window prefix (Ctrl-W) + underscore (_) when using a horizontal split, and pipe (|) for vertical ones! Use Ctrl-W + = to re-balance them :)
@admiralrodney3818
@admiralrodney3818 Жыл бұрын
@@devopstoolbox Ah I see. Its more convenient. Your video is great, keep it up!
@lebranding
@lebranding 7 ай бұрын
When comparing changes in a branch with the master in a PR, how do I view all the files that have been changed using Telescope?
@devopstoolbox
@devopstoolbox 7 ай бұрын
I'd check what Telescope has to offer -> `:Telescope git_` then hit tab for the autocompletion options. The ones that come to mind are git files and commits but I'm not sure this is exactly what you're looking for
@joselima7655
@joselima7655 4 ай бұрын
not sure why but on mine anytime there is a file tree manager like noetree or just netwrk typing :Git brings an empty window... I have to disable all this plugins for it to work.
@a_maxed_out_handle_of_30_chars
@a_maxed_out_handle_of_30_chars Жыл бұрын
fugitive seems so hard, maybe I need to use the plugin more to get used to it can you make a dedicated video on fugitive and how to use it?
@devopstoolbox
@devopstoolbox Жыл бұрын
Hey! This is the video intended for this exactly. Can you share where are the areas you're having hard time with and what specifically would you like to see in a different video to help you?
@ninjarogue
@ninjarogue 8 ай бұрын
how do you personally handle git merge conflicts in neovim?
@devopstoolbox
@devopstoolbox 8 ай бұрын
like so: Resolve Git Merge Conflicts with Neovim and Fugitive! kzbin.info/www/bejne/rKHae2qcpqlkeac
@cryptozmeu
@cryptozmeu 7 ай бұрын
using telescope git_commits how can I scroll into the right column to see all the changes in that commit? or another thing, if I want to see just all the files modified in a commit, do you have any tips? thanks
@devopstoolbox
@devopstoolbox 7 ай бұрын
As for scrolling the results you can set it up in the Telescope config mine is set for ctrl u / d for up and down the document. All the files modified as actually rather simple through the git status so just :G and you should see it all :)
@cryptozmeu
@cryptozmeu 7 ай бұрын
@@devopstoolbox I managed to install diffviewer which resolved all my issues, as for telescope scrolling I was in Insert mode , after pressing [Esc] to switch to normal mode C-d & C-u started working. I'm new to vim ( 6 days ) and I'm trying to configure it to achieve all the operations that I'm able to do in phpstorm. Thank you for all your videos, very helpful content. Right now I'm watching your video regarding the debugger 🍺🍺🍺
@devopstoolbox
@devopstoolbox 7 ай бұрын
@@cryptozmeu got it! Amazing. Take it slowly with Vim that’s my tip :) it’s a lot to take on and a lot to learn so do be too hard on yourself. Debugging is something I got to pretty late but definitely cool to have! Good luck 🍀
@cryptozmeu
@cryptozmeu 7 ай бұрын
@@devopstoolbox thank you, I managed to configure the debugger thanks to your video and additionally I set it up for php using xdebug/vscode-php-debug, I'll take it easy from here, but firstly I had to know that all my tools are in place for my daily activity: debugging (I use debugger a lot), git (merge diff tool, git history etc..) linters, lsp ...
@czintrpt5585
@czintrpt5585 Жыл бұрын
Can't find a link to your dotfiles, am I blind?
@devopstoolbox
@devopstoolbox Жыл бұрын
Hello there mate! I don't think blindness has to do with it :) I made an honest mistake and left it out, there it is: github.com/omerxx/dotfiles I'll also add it to the description
@yesidev4131
@yesidev4131 7 ай бұрын
I prefer use lazygit I think it's most easer than fugitive.
@devopstoolbox
@devopstoolbox 7 ай бұрын
Lots of people do! I think lazygit is great, the problem for me is that I feel it’s too “external”. I like things to be at the top of my fingers. The ability to stage commit and push from within the IDE makes a lot more sense. Maybe for more complex operations I’d use something else
@huricane555555
@huricane555555 8 ай бұрын
lazygit
@devopstoolbox
@devopstoolbox 8 ай бұрын
Great tool, I prefer something “closer to my fingers”
@czintrpt5585
@czintrpt5585 Жыл бұрын
`G log --oneline` presents it in a nice list. `Gclog` puts log into quickfix
@devopstoolbox
@devopstoolbox Жыл бұрын
Thanks for the additions!!
@andrewiglinski148
@andrewiglinski148 Жыл бұрын
Ah dude I could never get onboard with fugitive…. I use lazygit on the command line outside of vim anyways and there’s a plug-in for vim as well so for anyone that’s not into fugitive maybe check out lazygit
@devopstoolbox
@devopstoolbox Жыл бұрын
Totally :) everything is my subjective take on things and that doesn’t necessarily work for others I totally get that! My brain thinks in a way of “bring interrelated process as close as possible to each other”. For others the visual capabilities of lazygit can work wonders
@marioandresheviacavieres1923
@marioandresheviacavieres1923 6 ай бұрын
Thanks!
The Holy Grail of Neovim Git Integrations
13:28
DevOps Toolbox
Рет қаралды 29 М.
Is Nix Your New Terminal SUPERPOWER?
15:21
DevOps Toolbox
Рет қаралды 13 М.
СНЕЖКИ ЛЕТОМ?? #shorts
00:30
Паша Осадчий
Рет қаралды 7 МЛН
Sprinting with More and More Money
00:29
MrBeast
Рет қаралды 188 МЛН
Khóa ly biệt
01:00
Đào Nguyễn Ánh - Hữu Hưng
Рет қаралды 19 МЛН
⬅️🤔➡️
00:31
Celine Dept
Рет қаралды 44 МЛН
The Ultimate Database Control. Right WITHIN NEOVIM
9:35
DevOps Toolbox
Рет қаралды 51 М.
I'm never using Git the same way again
11:19
typecraft
Рет қаралды 82 М.
Which PLUGIN IS THE BEST for Neovim/Git? (PRACTICAL EXAMPLES included)
8:32
My Neovim & Tmux Terminal Dev Workflow As A Principal Engineer
9:22
DevOps Toolbox
Рет қаралды 36 М.
So You Think You Know Git - FOSDEM 2024
47:00
GitButler
Рет қаралды 999 М.
Automatically Execute *Anything* in Nvim
11:03
TJ DeVries
Рет қаралды 67 М.
5 Command Line Tools That Boost Developer Productivity (2023)
8:02
My Forever Dev Workflow
16:02
typecraft
Рет қаралды 68 М.
How Senior Programmers ACTUALLY Write Code
13:37
Thriving Technologist
Рет қаралды 1,4 МЛН
Harpoon : Vim Conference 2021
17:08
ThePrimeagen
Рет қаралды 105 М.
Secret Wireless charger 😱 #shorts
0:28
Mr DegrEE
Рет қаралды 705 М.
Samsung S24 Ultra professional shooting kit #shorts
0:12
Photographer Army
Рет қаралды 28 МЛН
🔥Идеальный чехол для iPhone! 📱 #apple #iphone
0:36
Не шарю!
Рет қаралды 1,3 МЛН
Нашел еще 70+ нововведений в iOS 18!
11:04