天道酬勤,学无止境

magit

Can't seem to push to GitHub using magit

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

2021-06-15 05:27:36    分类:问答    git   emacs   magit

使用 emacs(和 magit?)访问给定提交/分支/等中的文件(Using emacs (and magit?) to visit a file in given commit/branch/etc)

问题 如果我想查看foo.bar在某个提交<COMMIT_ID>样子,那么我可以调用: git show <COMMIT_ID>:foo.bar 很好...我怎么能在emacs做到这一点? 使用magit ? 使用vc ? 假设我正在访问文件foo.bar并且我想查看它在<COMMIT_ID>中的<COMMIT_ID> 。 回答1 在 Emacs 中执行此操作的规范方法是使用 VC:来自文件缓冲区的Cx v ~将要求您提供修订版,然后显示该文件在该修订版中的原样。 它应该适用于 VC 支持的任何控制系统,例如 Git、Bzr、... 回答2 Cx v l查看文件的历史记录。 n和p在提交之间移动。 f在提交时访问文件。 这与log-view-find-revision ,如果我们查看代码,我们会看到关键位是: (switch-to-buffer (vc-find-revision file revision))) 所以我们可以将它包装在一个自定义函数中,如下所示: (defun my-vc-visit-file-revision (file revision) "Visit FILE as it was at REVISION." (interactive (list (expand-file-name (read-file-name (if (buffer-file-name)

2021-06-12 10:03:22    分类:技术分享    git   emacs   magit

用于拉取请求的 emacs 最发达的 magit/github 扩展(Most developed magit/github extension for emacs for pull requests)

问题 我对拉取请求、编辑问题并将它们绑定到提交以及其他我通常必须在命令行上使用集线器的事情特别感兴趣。 但是,我已经开始使用 magit 并且非常喜欢键绑定和通用界面——我也想在这部分留在 emacs 中,而不是需要为拉取请求、问题等保持一个额外的 shell。 我能找到的可能为 magit 添加最多 github 功能的包是: 马github magit-gh-pulls 盖尔 任何可能参与这些项目的人都可以推荐他们如何比较以及将拉取请求集成到 magit 环境中的最佳方法吗? 回答1 最终我将在 Magit 中实现这些东西(我是维护者),但我首先必须发布一个版本。 过时的旧信息:不幸的是,目前也没有第三方扩展可以填补这个角色。 magithub已经坏了很长时间了。 magit-gh-pulls (由 Yann,作为 Magit 维护者的前任)也没有与 Magit 的变化保持同步。 前一段时间我试图修复它,但是当很明显这样做会导致完全重写时放弃了。 gh.el也由 Yann 编写,并由magit-gh-pulls 。 我过去曾为它做出过贡献,但最终停止使用它,因为 (a) 它使用url.el并且结果非常不可靠 (b) 它过于复杂。 所以我担心目前没有一个包可以做你想要的。 如果你想自己写,我建议你使用request.el ,然后只实现你真正需要的 Github api 的那些部分

2021-06-12 03:43:54    分类:技术分享    git   emacs   github   magit

Emacs — 如何将 Git 存储库推送到多个远程服务器(Emacs — How to push a Git repository to multiple remotes)

问题 我正在寻找一些帮助,请使用 Emacs / Magit 将本地存储库更改一举推送到远程网站和 Github。 我发现了一个非 Emacs / 非 Magit 相关线程(https://stackoverflow.com/a/3195446/2112489),有评论指出这是推送到远程和 Github 的最终答案,并且它有一个几百个赞。 我认为(可能是错误的)这是我计算机上$HOME目录中本地.gitconfig文件的一个很好的起点。 [remote "GitHub"] url = git@github.com:elliottcable/Paws.o.git fetch = +refs/heads/*:refs/remotes/GitHub/* [branch "Master"] remote = GitHub merge = refs/heads/Master [remote "Codaset"] url = git@codaset.com:elliottcable/paws-o.git fetch = +refs/heads/*:refs/remotes/Codaset/* [remote "Paws"] url = git@github.com:Paws/Paws.o.git fetch = +refs/heads/*:refs/remotes/Paws/* Emacs /

2021-06-11 20:36:23    分类:技术分享    emacs   elisp   magit

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

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 tip of your current branch is behind hint: its remote counterpart. Merge the remote changes (e.g. 'git

2021-06-11 16:26:54    分类:问答    git   emacs   github   magit

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

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

2021-06-11 05:46:18    分类:问答    windows   git   emacs   magit

在 Magit 中查看文件的历史记录?(View a file's history in Magit?)

问题 使用 Git 版本控制查看文件的更改历史讨论了在 Git 中查看文件历史的其他方法。 可以在 Emacs Magit 中完成吗? 回答1 从 magit 2.1 开始: magit-log-buffer-file (根据下面的评论) 在 magit 2.1 之前: magit-file-log是您正在寻找的。 它将在标准 magit 日志视图中显示当前缓冲区中文件的所有提交。 回答2 打开magit-status缓冲,通过键入Mx magit-status (我曾经有过这样势必C-. Cg ,因为它使用的所有的时间。这些天,我用Spacemacs所以它<SPC> gs ) 键入l以获取日志查看选项键入--设置“限制到文件”选项(以前是=f ) 输入要查看历史记录的文件路径输入l查看当前分支的日志 如果您使用的是 Spacemacs,则可以使用<SPC> gfh获取当前访问过的文件的历史记录 回答3 在您的*magit: <project>*缓冲区中,使用l进入日志记录模式,然后按f以提示输入文件名。 回答4 我不知道有什么办法。 我只是使用Mx vc-print-log似乎完成了同样的壮举。 不过,这不是一种与 magit 集成的方式。 回答5 如果magit(用户手册)没有这个功能,那么你可以看看其他Emacs模式,并添加你自己的git-log-file功能: (defun

2021-06-09 14:06:59    分类:技术分享    git   emacs   magit

Compare foo.bar from two different branches in MAGIT [duplicate]

This question already has answers here: magit: how to diff the same file between two different commits on the same branch? (4 answers) Closed 9 months ago. 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?

2021-06-04 10:22:41    分类:问答    git   emacs   magit

Most developed magit/github extension for emacs for pull requests

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

2021-05-17 05:58:48    分类:问答    git   emacs   github   magit

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

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>.

2021-05-15 19:45:02    分类:问答    git   emacs   magit