How to Use Git Worktree | Checkout Multiple Git Branches at Once

Поделиться
HTML-код
  • Опубликовано: 30 сен 2024

Комментарии • 30

  • @HunterRoMike
    @HunterRoMike 10 дней назад +1

    Great presentation. Howveer I find git worktrees pretty useless, especially when working on huge projects with heavy IDEs.
    I'd rather just commit all changes, use a descriptive commit message, chenge branch and fix whatever bug needs to be fixed, and then just check out the original branch and git reset --soft HEAD~1 and continue working on whatever feature I was working on before.

  • @amansagar4948
    @amansagar4948 2 месяца назад +2

    How is that different from cloning the repository again into a separate folder ?

    • @isaacressler8177
      @isaacressler8177 2 месяца назад

      In a lot of ways it's the exact same, however it enables tools like VSC to support multiple copies, like he showed. If that doesn't have any value to you it's not a tool for you.

  • @ChristerBlomqvist
    @ChristerBlomqvist 2 года назад +7

    I really like your presentation style and especially that you show the actual underlying git commands.

  • @danylohromyak5228
    @danylohromyak5228 Год назад +1

    Why does everyone use a terminal instead of a built-in vscode git GUI?

  • @yoavgro3
    @yoavgro3 Год назад +2

    I don't understand how the new work tree relates to remote. can you explain how can I push this worktree, create a pr on branches there later, etc.

  • @dannywidjaya7943
    @dannywidjaya7943 29 дней назад

    how is this better than simply cloning to a different folder? less mental load.

  • @apefu
    @apefu 2 года назад +1

    I am very surprised how annoyed I get by there being no space at the end of PS1.

  • @a_maxed_out_handle_of_30_chars
    @a_maxed_out_handle_of_30_chars Год назад +2

    thank you, simple and to the point :)

  • @Shinwe
    @Shinwe 7 месяцев назад +1

    Great and simple, thank you.

  • @chrisidema
    @chrisidema 2 года назад +1

    Pretty neat. I hate stash as I can forget about it. I often create a new branch for temporary commits.

  • @neessaa8713
    @neessaa8713 2 года назад +2

    10/10 tutorial! thank you very much!

    • @GitKraken
      @GitKraken  2 года назад +1

      Glad it was helpful!

  • @ElHombreDelSaco773
    @ElHombreDelSaco773 Месяц назад

    This is really what I was looking for to implement in git repositories, work in multiple branches at the same time in my engineering projects !! Thank you ! :)

  • @jacques-dev
    @jacques-dev Год назад

    Does GitKraken support worktrees? I made a new worktree from the command line called `main`, and I can push pull fetch etc. just fine from the CLI. But when I open the repo in GitKraken and try to push or pull I get the following error: `could not determine remote for 'refs/remotes/origin/main'`

  • @graciborski
    @graciborski 11 месяцев назад +1

    Beautiful introduction

  • @dbt6572
    @dbt6572 Год назад +1

    Thanks, Dwayne. Very clear.

  • @kristupasqwert9888
    @kristupasqwert9888 2 года назад +1

    How would you link your node_modules with a new branch to avoid reinstalling deps?

    • @GitKraken
      @GitKraken  2 года назад

      I believe the same way you would normally when working in a branch. This is just a way to move a copy of a branch to another folder and should not cause breaking changes to the node workflow. Ultimately the .git folder is tracking these branches as it always does, just has multiple referenced at once.

    • @radekkokon3720
      @radekkokon3720 2 года назад

      Haven't tested it but I think a symbolic link to an existing node_modules directory from new branch might work.

    • @trusabaka9747
      @trusabaka9747 4 месяца назад

      @@GitKraken It could be a good idea for you to show the same what you have shown here with the actual say, React, project. How it will work (or not?) when the worktree is checked out? Thank you.

  • @gersonscheffer2765
    @gersonscheffer2765 2 года назад

    great video.However I think commit with a message and after use squash it is more practical than using worktree

  • @bassam.2023
    @bassam.2023 2 года назад

    Useful tutorial, especially because you showed how things work in the background, that is, via the command line. Thanks!

  • @ruixue6955
    @ruixue6955 Год назад

    1:10
    1:22
    2:50 3 git worktree commands
    3:02 git worktree list
    3:16 git worktree add
    6:13 git worktree remove

  • @ahirusan1147
    @ahirusan1147 Год назад

    Thank you for this tutorial, it makes years I was looking for that feature!

  • @mateustymoniuk
    @mateustymoniuk 2 года назад

    You saved me from getting lost in stashes and temporary local branches, thanks a lot!

  • @plopplop.
    @plopplop. Год назад +2

    I'm annoyed by the `~` in your command line when you're not actually in your home directory.