Git Worktree Tutorial | The Most Underrated Git Command?

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ค. 2024
  • Hello 👋🏼 Today we are looking at the git worktree command. This is a very useful and simple command to learn and can save you lots of time in the future! I hope you enjoy :)
    Useful Links:
    Documentation: git-scm.com/docs/git-worktree
    Music:
    • Anime and Chill
    Huge thank you to Harris Heller for providing copyright-free music.
    Hey everyone! My name is Redhwan Nacef (Red for short). In this channel, I'm hoping to share my thoughts on software engineering, coding, management, and all things tech. I hope you enjoy!
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @tiamabderezai5374
    @tiamabderezai5374 ปีที่แล้ว +11

    Worktrees solve half of all my problems... Seriously it's such a rarely known, yet effective tool in Git
    Also, really like the way you share the terminal and your background, first time seen someone do that 😀

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

      Great to hear. Thanks, I got the idea from @devaslife so all credit goes to him!

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

    I think I'm gonna steal the idea of putting camera behind the blur if I will go into streaming. :) Nice idea.

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

      Go for it! 👌🏼 Thanks.

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

    For a better tutorial, two things. First, using the full, non-aliased commands would be clearer on what's being done and be easier to process than having to constantly do the mental conversions. Second, having the second worktree that's not located in hidden directory (that also requires a blanket gitignore entry) but in the root of the bare clone directory would be better for general simplicity of explaining the concepts.

  • @KuldeepSingh-vw6cx
    @KuldeepSingh-vw6cx 3 หลายเดือนก่อน

    Really, on point. Thanks man! 🤟

  • @a_maxed_out_handle_of_30_chars
    @a_maxed_out_handle_of_30_chars 10 หลายเดือนก่อน +2

    simple and to the point, thank you :)

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

      Thanks :)

  • @tinotaylor
    @tinotaylor 3 หลายเดือนก่อน

    Thanks for the clear explanation

  • @Marco-he6fx
    @Marco-he6fx 4 หลายเดือนก่อน

    Thank you very much for this video, it's very clear! What are you using for the suggestions inside the terminal?

  • @guhanbalasubramanian4144
    @guhanbalasubramanian4144 4 หลายเดือนก่อน

    Interesting video. On as side note, what is the terminal and font used in this video?

  • @andrewdatar9880
    @andrewdatar9880 10 หลายเดือนก่อน

    Thank you. Your git aliases are really cool. Do you have a video/article about how did you make them?

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

    Thanks! Would you say worktree is an alternative to stash or to creating temporary branches? What are the advantages or disadvantages of worktree compared with other commands?

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

      You're welcome. Yes I would, I think the main advantage of worktrees is the simplicity. You can leave your worktree in its current state untouched and comeback to it. If you use stash or branch (which I used to do), you need to know about other git commands. You need to make sure you commit/add files which can get messy if you add/remove dependencies or need a different environment set up. Then when you go back to working on it, you need to again make sure the environment is back to its previous state and then "uncommit" changes to see what you were working on or continue without context. Hope that makes sense!

  • @zyax123
    @zyax123 5 หลายเดือนก่อน

    Can’t believe you’re not a +100k sub channel.
    The transparent terminal with you in the background, the informative content and the hacker workflow.

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

    Very useful video. What about .gitignore files - say that you have some .env files and you have upgraded some packages on you feature branch?

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

      Thanks! Sorry, not sure I understand are asking here? This should all resolve just fine once rebasing/merging the feature branch in?

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

    good explained - thanks

  • @stefans2068
    @stefans2068 10 หลายเดือนก่อน

    Thx nice over few, so git worktree is basically a little simplified git clone, too sad that the folder management is not included/automaed.

  • @felipegouvea6141
    @felipegouvea6141 2 ปีที่แล้ว

    I'd like to ask you a thing, how can I contact you?

    • @RedhwanNacef
      @RedhwanNacef  2 ปีที่แล้ว

      redhwannacef.com/contact

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

    this video smells like _thePrimeagen_

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

      Maybe, but then every prime video smells like the two-time, and that's okay.

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

      Not quite as blazingly fast.