You might want to try out smerge-mode just open the conflicted file and do M-xsmerge-modeRET. It will highlight all the conflicted regions. It also adds keybindings to easily resolve the conflicts, consult its documenation C-hfsmerge-modeRET to know them.
I find the default prefix for smerge-mode C-c^ cumbersome so I have changed it to C-...
Let's pretend for a moment that you want to add something to the HEAD commit, i.e. "the second commit B" in your example.
The commit popup on c features a binding "a Amend". Pressing that key will "amend" the staged changes to the HEAD commit. Since commits are not mutable in Git, this will actually replace the old commit with a new commit. A buffer with ...
Starting with v2.1 you can change the upstream of the current branch to a remote or local branch using bu[REMOTE/]BRANCHRET. Starting with v2.4, if an upstream is already set, then bu will just unset it. Press u again to set a new value.
Starting with v2.4 and if the upstream is unset, you can also set upstream while pushing by using pu[REMOTE/]BRANCHRET. ...
You can view a file for a specific revision using M-x magit-find-file RET <filename> RET.
Or you can first view the diff for commit by pressing RET on it, navigating to the file inside the diff, and then pressing RET again.
To stage a change press s with point on any "stageable change". This includes files listed below "Untracked files" and "Unstaged changes".
You can also expand the files below "Unstaged files" using TAB (also works for many other sections) to see the hunks. You can then stage an individual hunk, again by pressing s while point is inside it.
You can even ...
You can use one of the below to discard changes in unstaged files:
M-x magit-revert-item (bound to v in magit-status-mode)
M-x magit-discard-item (bound to k in magit-status-mode) - works on staged items too
Using either method will ask you to confirm before discarding.
Edit: since this answer got more upvotes than I expected, I expanded it a bit.
To supplement the answer by @IqbalAnsari, you could also use vc-resolve-conflicts (as mentioned by others, it is an alias to smerge-ediff). This will start the ediff interface. On the left will be the first merge parent, and the second merge parent on the right. They are ...
git config status.showUntrackedFiles all
or if you want to enable this in all repositories:
git config --global status.showUntrackedFiles all
and refresh the status buffer. Initially you will still only see directories which contain untracked files, not the files themselves. But these directory sections can now be expanded using TAB.
One possible ...
I would like to list the available tags in Magit ...
Type y to show a buffer which lists branches, remote branches, and, at the bottom, tags.
...in order to diff a specific revision [reachable from that tag]
Move to the tag and press l o RET. That shows the log for that tag. Move to the commit and press RET. That shows information about that commit, ...
In Magit commits are created using the committing popup (c). That popup would therefore be a good place to start looking for gpg support. If you do that, then you will find this:
=S Sign using gpg (--gpg-sign=)
So type = S and the select a key. To avoid having to do that every time you create a commit you can save the value of that argument (and all other ...
When you run git config --global core.editor emacs -nw, your shell splits the command line into words before invoking git. Git thus sees "emacs -nw" as two separate arguments. It only needs one to put into the config file, so the other is ignored. (Actually, that's a lie but you can check the man page for details.) You can put quotes around a series of words ...
You can use magit-reset (bound by default to x). The
commit at point will be used as the default for the prompt, but you
can enter any revision value you'd like ("HEAD~" here).
The resetting commands are described in the "Resetting" section of the
To reuse the commit message, you can use the =C option ...
Reversing, reverting and discarding are distinct actions. Together with staging and unstaging, they are referred to as "apply variants".
To discard a change means to throw it away. Only un-committed changes can be discarded. When a staged change is discarded it is not only removed from the index (that is known as unstaging), but also from the work tree.
You just need to add ".gpg" at the end of the file name (for example, you could use "private.org.gpg" for an org file), and put at the end
# Local Variables:
# epa-file-encrypt-to: "firstname.lastname@example.org"
where email@example.com identify a gpg key you use for encrypting this file.
Specifically what I am after is to list the revision history at a certain tag
It sounds like you already know the tag you need, in which case:
lrl type tag name (with TAB completion) RETRET
lo type tag name (with TAB completion) RET
I have just completed a rebase and noticed some inconsistencies
Or use the reflog to find the pre-...
Press "P C-u C-u P" to make Magit ask you what remote and remote branch to use before pushing.
(With a single prefix argument ("P C-u P") Magit asks what remote to use.)
I found this by pressing P C-h k P in a Magit status buffer, reading the docs of magit-push and magit-push-dwim (these docs seem to be out of date, BTW), and experimenting.
PS: I use ...
If you use magit you can create a stash with the z z command from the magit-status buffer. You can also pop a stash using the A command.
If you use these commands, affected files will be automatically reverted (changes are loaded).
Check out the magit documentation for more info on how to use magit effectively.
You can customize/set magit-diff-refine-hunk to highlight word changes. magit-diff-toggle-refine-hunk, bound to D t, can be used to change it on the fly.
magit-diff-refine-hunk is a variable defined in `magit-diff.el'.
Whether to show word-granularity differences within diff hunks.
nil never show fine differences.
t show fine differences for the ...
I have actually done rather a lot of research on this and fundamentally the problem is that git for windows sucks
This is the upstream bug: https://github.com/git-for-windows/git/issues/596 and it requires somebody to rewrite shell scripts in C so that there is no more command forking. For me, its the interactive rebase that is the real killer (I can kick ...
As noted in many answers to the question you have linked to and even more so in comments on those answers, git checkout source_branch -- <paths>... does not perform a merge.
Never-the-less there are of course situations when you want to do that - just don't call it a "merge". It would be much more appropriate to talk about "putting a file in the ...