4 ms·
> I want to edit the commit message of a commit that is 5 commits in the past, that I have not pushed yet. What is the command to do it? Probably something lik
by ilikepi 8y ago
> I want to edit the commit message of a commit that is 5 commits in the past, that I have not pushed yet. What is the command to do it?
Probably something like:
git --rebase -i --force HEAD~6
...followed by setting the commit in question to "edit"; then once the rebase pauses on that commit, using `commit --amend` to edit the message; and finally `rebase --continue`.
> Okay so it turns out I made a minor typo in that commit and I want to change it without adding any more commits. What is the command to do it?
Same as above, except you'd make the necessary change before `commit --amend`.
> Okay so now I want to take all commits that have "bugfix pickme" in the subject and cherry-pick them to master. What is the command to do it?
With a decent interface, these actions are basically trivial.
You might be able to do this with one of the filter commands, but I haven't used them enough to know. I'd probably just write a shell one-liner for this instead.
> I've been using git for several years and I have to think way too hard to figure out what to type just to get what I want to happen. All too frequently I just say 'screw it' and make a sad commit because my job is writing software, not wrestling with git commands.
Yeah, it's totally understandable. Between myself and the other dev on my team, I am the de facto git fixer. My coworker occasionally digs himself into a hole and becomes frustrated. Then the next day I do that with CSS, and he has to bail me out. I guess the point is most people have things they are motivated to specialize in.
- mehrdadn 8y agoHow do your your intervening submodules additions/removals turn out when you rebase?
- Noumenon72 8y agoDo you view that as in any way acceptable for a UI? All of these things are ultra-common operations. If Outlook were written this way, you'd have to type git inbox --full-conversation -next to read an email, and read it in less.
- nordsieck 8y ago> Do you view that as in any way acceptable for a UI? The reason git is great as a console program is because the fundamental underlying problem you're trying to solve (graph manipulation) is complex. Graphical UIs only work for simple problems. I think most people would like a simple graphical UI, but no one has been able to create one that has the same power as the textual one. This is akin to the reason people don't use visual programming languages.
- mehrdadn 8y ago> The reason git is great as a console program is because the fundamental underlying problem you're trying to solve (graph manipulation) is complex. Graphical UIs only work for simple problems. Is this meant to be ironic? Everything is literally the opposite of what you said. The entire reason why people make programs like the one you see here is literally that git sucks as a console program, making tasks that are inherently simple (and demonstrably so with a GUI like TortoiseGit) much harder on the command line.