3 ms·
> can't easily be done with the command line. git add -p ?
by fragmede 2y ago
> can't easily be done with the command line.
git add -p
?
- metaltyphoon 2y agoLearning the -p was the biggest gain I’ve had after years of using git via cmdline only.
- suzzer99 2y agoWhich is kind of the point. If a GUI editor does this stuff for you, that seems like a win over incrementally learning these little command line tricks that save you a bunch of time.
- metaltyphoon 2y agoThat’s fine for some and I have no problems with it but my mind doesn’t work that way and instead it asked “how is possible the UI is doing this”. All of that lead to learning what hunks are and manually editing them to learn.
- greg5green 2y agoYou can do it with stash too!
- suzzer99 2y agoHow does this scan a bunch of repos at once and let me see all the changes at a glance, and then drill down to individual files to either discard the changes (revert back to their committed state) or check them in? All git add -p does is that last part from what I can tell. I'd still have to cd into each repo and run git status one by one (I've made changes to up to 10 repos before for one tweak), and then do a git add -p to the changes I do want, and a git stash to the changes I don't and then delete the stash.
- fragmede 2y agoIf "cd" and "git status" in a bash for loop is too advanced, you might need a GUI. Though I'd also argue that you've got too many separate git repos if you're finding yourself needing to do that often. It all depends on where you are on the journey to Monorepoland.
- suzzer99 2y agoWe're too small to implement a monorepo, because no one has time to build the tools we'd need to do it right. I still don't see what I gain by cd-ing into all those directories and running git status and looking at a bunch of text results, when I can just glance at the SourceTree repo window and see all the repos I've touched.
- nicoburns 2y agoI would argue that "git add -p" is the one thing which is unambiguously better with a GUI. Scrolling through changes and staging lines is just much nicer with a mouse.
- robertlagrant 2y agoI semi-agree - the real win is in unstaging changes you didn't mean to stage! Much easier in a GUI, because I don't have to remember the non-symmetric CLI command.