Many commands in magit pop up a small buffer prompting you to specify options. To see the commits for a specific file, in the git status buffer type "l -f ". Then you will see all of the commits for 1 file! cool!
You typically start a magit section by running magit-status
. You can stage un-staged with "s". You can commit those changes with "cc". You can push those changes with "Pp".
Un-staging commits can be done via "u".
$
will add another buffer that shows you the commands magit is commitings
on a modified file will stage itS
will stage all modified filesi
will add the current file to the project’s git ignoreu
will unstage the current modified filec c
will commit your staged changes. Type in a message in the buffer that appears, and then hit C-c C-c
to close the bufferP P
will push your changesF F
will pull your changesy
will take you to the branch managerl r l
will allow you to see the commits that make two branches differ. This happens when branch "master" is behind branch "new feature". You can see the differences between the two branches and cherrypick them.a
will apple the current commit to your current branch. This allows me to cherry pick changes from one "bug fix" branch to theA
does the same as above, but it tries to automatically commit the changes if there are no merge conflicts.v
will revert the commit. It will apply the changes made by a commit in reverse. But you still need to commit the changes.C-c u
unmark marked commits=
show the differ between the marked commit and the commit under pointk
will delete the branch under pointC-u k
will force delete a branch under pointc
will create a new branchr
renames the branchT
on a local branch changes which remote branch it tracksFirst find the patch via issues.guix.gnu.org or debbugs.
guix install emacs-debbugs
M-x debbugs-gnu-search BugNumber RET ([2022-07-07 Thu] I cannot do this on doom emacs currently. Do a emacs -q and it'll work.)
Find the email via debbugs, and type in O m to save the file.
Then open up M-x magit-status RET w m to apply the patch.
magit may give you an odd error. But you can always check the log. Sometimes it applies the patch, and still gives you an error.
:ircChats:
gnucode │ is there an easy way to apply a patch from debbugs-gnu to my local guix repository? unmatched-paren │ gnucode: download the mbox and `git am` away :) gnucode │ unmatched-paren that seems very tedious... unmatched-paren │ curl might be able to make it easier gnucode │ It would be nice if I could apply the patch from emacs and debbugs...just my 2 cents. morganw │ I think there is an Emacs package which can apply git patches that are in a mail message. unmatched-paren │ I use aerc which allows me to download and apply the mbox automatically, not sure whether $EMACS_MAIL_CLIENT can do that unmatched-paren │ aerc command is :pipe -mb git am -3 unmatched-paren │ "pipe the mbox into git am three-way" gnucode │ unmatched-paren are you using mbox to read the guix email achives? unmatched-paren │ gnucode: what do you mean? unmatched-paren │ i think aerc uses maildir by default gnucode │ ok. Maybe I should give aerc a try. I keep wanting to use emacs for most of my email and everything needs. But I have a really hard time figuring out how to use it. gnucode │ I used to be able to send email via emacs...now I can't. morganw │ gnucode: I think this is one some people use: https://git.kyleam.com/piem unmatched-paren │ aerc uses vi commands, fyi gnucode │ I am using evil-mode unmatched-paren │ ah unmatched-paren │ gnucode: I'm afraid my patch adding aerc hasn't been merged yet though unmatched-paren │ because of the general lack of vi users around here :) morganw │ It believe that if you use Gnus there is also a built in command to send the message buffer to a pipe and so something with it. morganw │ *do something morganw │ Or possibly it was built into message mode, I think I tried it once but I don't remember the exact process. unmatched-paren │ maybe there's a way to pipe the mbox too gnucode │ I just found this: https://emacs.stackexchange.com/questions/36885/how-do-i-apply-a-patch-from-gnus-to-a-git-repo gnucode │ seems promising unmatched-paren │ nice! ulfvonbelow │ M-> C- M-< M-| ulfvonbelow │ that works with any buffer btw rekado_ │ gnucode: I use mu4e (which uses gnus message mode to display emails) and wired up the mu4e-action-git-apply-mbox action. gnucode │ rekado_: do you ever use debbugs? rekado_ │ I dog-food mumi / issues.guix.gnu.org gnucode │ rekado_: hahah. :END:
Visit a magit buffer and run magit-blame
. Magit will divide the buffer into regions, and list which region belongs to which git author and in what commit. It awesome!
M-w saves the hash of the current region to the kill ring.
"n" and "p" move to the next and previous hunks.
https://www.youtube.com/watch?v=mtliRYQd0j4
Put point on a commit you want to split open:
Rebase -> m modify a commmit
magit-reset (x) RET head~ RET
This puts head at the position before the commit you want to modify. And you are free to split the commit.
rebase -> c continue for complete the action