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

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ก.ย. 2024

ความคิดเห็น • 62

  • @devopstoolbox
    @devopstoolbox  ปีที่แล้ว +3

    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 ปีที่แล้ว +11

    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  ปีที่แล้ว +2

      Nice! Thanks!

    • @JakeDuthDev
      @JakeDuthDev 11 หลายเดือนก่อน +2

      s is a pneumonic for "stage"

  • @ShaneCurtis-nl2ev
    @ShaneCurtis-nl2ev 2 หลายเดือนก่อน +1

    This video editing format is sooooo satisfying

  • @bridgey2012
    @bridgey2012 ปีที่แล้ว +5

    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 ปีที่แล้ว +6

    awesome video, I haven't tried fugitive yet, u inspired me to do so, currently I'm using lazygit+toggelterm combo

    • @devopstoolbox
      @devopstoolbox  ปีที่แล้ว +2

      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 :)

  • @typecraft_dev
    @typecraft_dev ปีที่แล้ว +2

    love fugitive. Great video as always, awesome style!

  • @sreedev
    @sreedev ปีที่แล้ว +1

    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".

  • @notko8431
    @notko8431 ปีที่แล้ว +1

    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 :)

  • @need4eat
    @need4eat ปีที่แล้ว +1

    Liked before watching. I know it’s going to be awesome ❤

    • @devopstoolbox
      @devopstoolbox  ปีที่แล้ว

      This warms my heart! Thank you so much 😀

  • @theIbraDev
    @theIbraDev 11 หลายเดือนก่อน +1

    Came back to this video to say thank you, my colleagues think i'm a wizard because of you.

    • @devopstoolbox
      @devopstoolbox  11 หลายเดือนก่อน +1

      Yeah!! 🫡🫶

  • @yash1152
    @yash1152 ปีที่แล้ว

    0:17 nice keypress overlays
    (between left center, and left bottom)

  • @annusingh4694
    @annusingh4694 ปีที่แล้ว

    Awesome video! Thank you 🎉

  • @Guilherme-qk9so
    @Guilherme-qk9so ปีที่แล้ว

    great video! Thanks! :)

  • @hungvx-dev
    @hungvx-dev 2 หลายเดือนก่อน

    Hi. What is the bluring transparent browser?

  • @marioandresheviacavieres1923
    @marioandresheviacavieres1923 9 หลายเดือนก่อน

    Thanks!

  • @devstefancho
    @devstefancho ปีที่แล้ว +1

    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  11 หลายเดือนก่อน

      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

  • @joselima7655
    @joselima7655 7 หลายเดือนก่อน

    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.

  • @enmanuellagares
    @enmanuellagares ปีที่แล้ว +1

    Hey @DevOps Toolbox, could you show us how you overlap the transparent terminal on top of your video?

    • @devopstoolbox
      @devopstoolbox  ปีที่แล้ว +3

      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 ปีที่แล้ว +1

      @@devopstoolbox Thank you for the help! I really like your vibe

  • @a_maxed_out_handle_of_30_chars
    @a_maxed_out_handle_of_30_chars ปีที่แล้ว +1

    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  ปีที่แล้ว +1

      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 11 หลายเดือนก่อน +1

    how do you personally handle git merge conflicts in neovim?

    • @devopstoolbox
      @devopstoolbox  11 หลายเดือนก่อน +1

      like so: Resolve Git Merge Conflicts with Neovim and Fugitive!
      th-cam.com/video/vpwJ7fqD1CE/w-d-xo.html

  • @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  ปีที่แล้ว +1

      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!

  • @startup-streak
    @startup-streak 11 หลายเดือนก่อน

    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  10 หลายเดือนก่อน

      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

  • @cryptozmeu
    @cryptozmeu 10 หลายเดือนก่อน +1

    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  10 หลายเดือนก่อน

      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 10 หลายเดือนก่อน

      @@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  10 หลายเดือนก่อน

      @@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 10 หลายเดือนก่อน

      @@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 ...

  • @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  ปีที่แล้ว +2

      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!

  • @yesidev4131
    @yesidev4131 10 หลายเดือนก่อน +4

    I prefer use lazygit I think it's most easer than fugitive.

    • @devopstoolbox
      @devopstoolbox  10 หลายเดือนก่อน +3

      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

  • @CZiNTrPT
    @CZiNTrPT ปีที่แล้ว

    Can't find a link to your dotfiles, am I blind?

    • @devopstoolbox
      @devopstoolbox  ปีที่แล้ว +2

      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

  • @huricane555555
    @huricane555555 11 หลายเดือนก่อน

    lazygit

    • @devopstoolbox
      @devopstoolbox  11 หลายเดือนก่อน

      Great tool, I prefer something “closer to my fingers”

  • @CZiNTrPT
    @CZiNTrPT ปีที่แล้ว +2

    `G log --oneline` presents it in a nice list. `Gclog` puts log into quickfix

  • @andrewiglinski148
    @andrewiglinski148 ปีที่แล้ว +1

    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  ปีที่แล้ว +2

      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

  • @inteliconn995
    @inteliconn995 ปีที่แล้ว

    Thanks!