News for hackers. Stuff that matters.
Re:Modern Git Commands and Features You Should Be Using by nalgeon on Sunday March 31, 2024 @08:24PM (#39889564)
There's also an interactive "Git by Example" guide I recently wrote on a similar topic. It has a playground for each of the commands mentioned in Martin's article (and many others):

— switch

— restore

— sparse-checkout

— worktree

— bisect

https://antonz.org/git-by-example/

Re:Modern Git Commands and Features You Should Be Using by adamnemecek on Sunday March 31, 2024 @08:10PM (#39889499)
Is worktree good?
Re:Modern Git Commands and Features You Should Be Using by evanjrowley on Sunday March 31, 2024 @08:34PM (#39889633)
I barely know anything about git but one thing I do know is worktrees are the only way I can use it. My mind just doesn't work in a "only one or two branches at a time" mode
Re:Modern Git Commands and Features You Should Be Using by n8henrie on Sunday March 31, 2024 @08:30PM (#39889599)
I just learned about worktree (from a recent HN post IIRC) and thought it sounded really helpful for working on multiple simultaneous tasks in nixpkgs. Unfortunately I ran into some error trying to add a second worktree. Will have to take another look.
Re:Modern Git Commands and Features You Should Be Using by frfl on Sunday March 31, 2024 @08:56PM (#39889789)
For longer lived, bigger projects, absolutely. For smaller stuff, not as much. I use it everyday for $work, but rarely/if at all for any small personal stuff.

I and others wrote a number of things on a thread a few weeks ago: https://news.ycombinator.com/item?id=39594164

Re:Modern Git Commands and Features You Should Be Using by m3kw9 on Sunday March 31, 2024 @08:46PM (#39889711)
Git bisect is really useful to see who messed up
Re:Modern Git Commands and Features You Should Be Using by andreareina on Sunday March 31, 2024 @08:51PM (#39889749)
Git bisect is really useful for knowing what messed things up, and who would have context about why things were done that way.
Re:Modern Git Commands and Features You Should Be Using by faut_reflechir on Wednesday April 10, 2024 @10:52PM (#39997963)
having `git bisect run` do the thinking for you is incredible when it works
Re:Modern Git Commands and Features You Should Be Using by yablak on Monday April 01, 2024 @12:40AM (#39890974)
Still amazed there's no "git cp". the workarounds involve rebases and aren't practical.
Re:Modern Git Commands and Features You Should Be Using by cassianoleal on Monday April 01, 2024 @04:02AM (#39891777)
What do you mean by "git cp"? I have that aliased to "cherry-pick".

If you mean to copy a file/directory and stage it in the process (like "git rm" does for deleting), there's no need to rebase. Just copy the thing and stage it.

If it's something else, then the 2 paragraphs above might be a hint towards why there isn't one.