magit

How to diff a file with specific revision in git?

只谈情不闲聊 提交于 2019-12-22 11:56:33
问题 I don't know if git has concept of revision. I'd like to diff current working copy with older version of it(not neccesarily a last commit) Would be great if it could be done inside emacs. 回答1: I've no idea about doing this inside emacs, but: git diff rev1..rev2 will do what you want for the whole repository. You can then add to that: git diff rev1>..rev2 path path can be an absolute path to a file, or a path to a directory, so you can diff subtrees. If you're looking to diff the working copy

Get the VC root in Emacs Lisp

[亡魂溺海] 提交于 2019-12-22 07:01:21
问题 In an Emacs Lisp function, I want to know the VC root of an arbitrary folder (if under source control), the same as something like vc-print-root-log does it. I'm trying to do it from outside the VC file/folder (though creating a temporary buffer to do this would be fine). I currently have a git-only solution through magit - (magit-get-top-dir dir-name) . I tried using (vc-deduce-backend) and the 'root command, but the variables that vc-deduce-backend checks seems to only be set in existing vc

Compare foo.bar from two different branches in MAGIT

蓝咒 提交于 2019-12-21 07:04:52
问题 This answer shows how to see the differences between a specific file foo.bar in two different branches in git . My question is how to do this within magit ? 回答1: I use magit to complement vc . vc already has this functionality C-u C-x v = 回答2: Just wanted to note that this is now directly possible with magit . In the Magit status buffer, type d to open up the diff popup. Then limit the diff to your file of interest with =f and the file name. Finally, do a diff range r and type in the branch

magit: how to diff the same file between two different commits on the same branch?

断了今生、忘了曾经 提交于 2019-12-21 03:42:09
问题 How can I get the diff between two commits of the same file using magit ? Directly form git one can do this. But I don't know how to do it from within magit . From magit-status it seems that d and D returns the diff of the whole repository. This is very problematic for me as the repository is huge and it causes magit (and in turn emacs ) to become unresponsive. Is there a way to ask magit to restrict the search to only one file from the repository? I also tried, in the magit-status buffer to

Most developed magit/github extension for emacs for pull requests

烂漫一生 提交于 2019-12-20 10:29:08
问题 I'm specifically interested in pull requests, editing issues and tying them to commits, and other things I generally have to use hub on the command line for. However, I've started using magit and really like the keybindings and general interface---I'd like to stay in emacs for this part, too, rather than needing to keep an extra shell open for pull requests, issues, etc. The packages that might add the most github functionality to magit that I could find are: Magithub magit-gh-pulls gh.el Can

Magit : how to see pre-commit hooks before editing commit log?

放肆的年华 提交于 2019-12-13 15:56:37
问题 With git on the command line, you see the result of your pre-commit hooks before entering the commit's log message. If your pre-commit hook makes the commit fail, you are warnt and don't write anything. But with magit , you are asked to enter your log comment and then it evaluates your hook, and if it fails you don't see why . You just read : git exited abnormally with code 1. I understand this is normal because it is when you are finished editing the log message that magit runs the git

failed to push some refs to 'https://github.com/myname/myrepo'

天涯浪子 提交于 2019-12-12 08:59:54
问题 question on magit / push I'm starting using magit, with very little experience in git. I've gone trough the magit manual with success for : adding ignoring staging commiting locally Then, I try to push on github.com/myname. For that, I use 'P P', entering then my username and password. If fails with To https://github.com/myname/myrepo ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/myname/myrepo' hint: Updates were rejected because the

How to use git mv from magit?

只谈情不闲聊 提交于 2019-12-10 01:06:48
问题 Is there a nice way to call git mv on a file from within magit? I know it's possible to run any git command with : , but this won't autocomplete filenames. 回答1: I'm not sure offhand if there's a direct way, but... Given that a mv is the same thing as a rm plus an add , you can just rename the file normally (e.g. in dired), and then stage both of the consequent changes -- a deleted file and a new file. Git should figure it out. Edit: M-x vc-rename-file ? 回答2: For reference at least in current

how to deactivate vc-git in GNU Emacs?

天大地大妈咪最大 提交于 2019-12-08 19:55:28
问题 I created a Git repository for the folder with my Emacs text files, then installed git.el and Magit. Emacs seems to have slowed down a lot, and I keep seeing the message loading vc-git...done in the minibuffer. Am I right in thinking that interacting with Git is what's slowing down Emacs? I don't actually need to use Emacs to interact with Git, I usually just use GitHub anyway. I removed references to git.el and magit.el from my .emacs file, but I'm still getting the message. How do I disable

Can't seem to push to GitHub using magit

蹲街弑〆低调 提交于 2019-12-07 04:51:26
问题 I am attempting to push to a GitHub repository using Magit on Emacs 24.3.1. Note, I'm on a Windows box. I have staged and committed changes to a file and M-x magit-status reflects only untracked files that are resident to my clone of the repo. To push, from the Magit status buffer, I do P P and the message I get is: Running c:/Program Files (x86)/Git/bin/git.exe push -v origin master It seems to hang here and no further activity is evident. When I go to push from the command line, everything