Uwe Brauer <o...@mat.ucm.es> writes:
You should drop the `-b`, you switch to your branch using just `git checkout vc-diff-disp`. Then you need to stage your changes `git add lisp/vc/diff-mode.el lisp/vc/vc.el`, and finally commit themwith `git commit`.Ok git checkout vc-diff-disp did work but I still could not commit.It turned out that I needed git add lisp/vc/diff-mode.el git add lisp/vc/vc.el And that I really don't understand. These files were modified not created.In `git` you don't add files, you add (_stage_) changes. That is, you`git add` - new files (make them known to `git`) - changes to files already known to `git`- parts of change to files already known to `git` (see `git add -p`)So do I understand you correctly. I *always* have to run git add (-p) Before git ci?
Well, changes always have to be staged, but as you can see in the git-commit manpage there's an option to stage all changes to known files automatically by using
git commit -a
If so then I will try to use emacs's git interface.
If you mean magit I have to say it's absolutely worth trying. It's what I use to do 99% of the times I need to do some "git stuff".
There you _also_ have to stage changes, but the interface is a bit more clear about it.
BTW, I came across https://gregoryszorc.com/blog/2017/12/11/high-level-problems-with-git-and-how-to-fix-them/ in which the author claims: ,----| that Git is just a content indexed key-value store consisting of a different | object types (blobs, trees, and commits) that have a particular relationship| with each other. `----I can't say that I understand that, but he also states that one could disable the staging.Can't find anything about it. Hm
Staging is a bit of a mind-shift, but I do urge you to give it an honest shot before condemning it. When I switched to git from svn/hg I found it to be an utterly weird idea. Just a completely useless nuisance. Over time I've found it's grown on me, and now I miss it whenever I have to do work in a VCS that doesn't have it. In particular I've found that it allows me to not "self-censor"; I'll make any changes I want in my workspace, even ones that aren't related to the issue I'm working on at the moment, because I know that I can split the changes into multiple commits later on. Staging is the mechanism that enables that.
/M -- Magnus Therning OpenPGP: 0x927912051716CE39 email: mag...@therning.org @magthe@mastodon.technology http://magnus.therning.org/Only put off until tomorrow what you are willing to die having left
undone. — Pablo Picasso -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/git-users/8735q5kog4.fsf%40therning.org.
signature.asc
Description: PGP signature