magit

How to diff a file with specific revision in git?

若如初见. 提交于 2019-12-06 15:33:46
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. 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 - just specify revision 1: git diff rev1 path The revision codes can be special names, e.g. HEAD^..HEAD

Can't seem to push to GitHub using magit

折月煮酒 提交于 2019-12-05 08:38:14
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 seems fine and I am prompted for my GitHub username: PS H:\.emacs.d> git push -v origin master Pushing

How to use git mv from magit?

。_饼干妹妹 提交于 2019-12-04 22:25:01
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. 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 ? For reference at least in current verion of magit there is magit-file-rename which can be invoked by R . I use dired for this. C-x d when the file

why is vc-git and magit in emacs ignoring my git config settings?

我是研究僧i 提交于 2019-12-04 12:31:10
I'm running the official windows binary of emacs 24.1.1 with magit. When I commit a file, the username and email shown on the log are ripped from my account and machine name, rather than using the values set in either the global git config or the local settings for this repro. From git bash and dos, I can ask git for user.email and user.name and get the local repro settings. magit and vc-git's diff mode also seems to be ignoring my autocrlf settings, so this may be an emacs-wide problem, not specific to magit. C:\Program Files (x86)\Git\cmd is is on emac's exec-path . How can I either instruct

View a file's history in Magit?

雨燕双飞 提交于 2019-12-04 07:38:31
问题 View the change history of a file using Git versioning talks about other ways of viewing history of a file in Git. Can it be done in Emacs Magit? 回答1: Since magit 2.1: magit-log-buffer-file (as per comment below) Before magit 2.1: magit-file-log is what you are looking for. It will show you all commits for the file in the current buffer in the standard magit log view. 回答2: Open your magit-status buffer, by typing M-x magit-status (I used to have this bound to C-. C-g because it is used all

Emacs / Magit — how to create and delete repositories on Github

左心房为你撑大大i 提交于 2019-12-04 04:23:53
问题 I am having trouble in Magit with step number 5 and step number 7 to create a new repository. If they exist, what are the interactive function equivalents (please) for steps 5 and 7? If there are no interactive equivalents, I guess I will need to write my own shell command functions -- unless, of course, someone would like to take a stab at them first. :) CREATE -- COMMAND-LINE RECIPE 1. $ touch README.md 2. $ /usr/local/git/bin/git init 3. $ /usr/local/git/bin/git add . 4. $ /usr/local/git

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

左心房为你撑大大i 提交于 2019-12-03 11:07:12
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 do : diff $start_commit..$end_commit -- path/to/file . This works, but the output is a simple buffer

Using emacs (and magit?) to visit a file in given commit/branch/etc

会有一股神秘感。 提交于 2019-12-03 03:11:33
问题 If I want to see how foo.bar looked like in some certain commit <COMMIT_ID> then I can invoke: git show <COMMIT_ID>:foo.bar Nice... How can I do it in emacs ? Using magit ? Using vc ? Say I am visiting the file foo.bar and I want to look up how it looked in <COMMIT_ID> . 回答1: The canonical way to do that in Emacs is to use VC: C-x v ~ from the file's buffer will ask you for a revision and then show that file as it was at that revision. It should work for any control system supported by VC,

Most developed magit/github extension for emacs for pull requests

旧巷老猫 提交于 2019-12-02 22:41:16
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 anyone, possibly involved with these projects, recommend how they'd compare and what might be best for

Accidental commit; how to not push an unpushed commit in Magit Emacs

与世无争的帅哥 提交于 2019-12-02 19:14:50
问题 I did an accidental commit which really makes no sense to have anywhere in history. How can I remove this commit from existence (especially I don't want it appear remotely). In the magit-status, it shows: Unpushed commits: fe73b07 updated gitignore 974e70d test ab333e6 trying to go with a flat structure What can I do? Bonus: actually, I just want to keep the "updated gitignore" from this commit. 回答1: Point at test, press E to start a rebase. M-n two swap commits. C-c C-c to finalize. Resolve