Difference between revisions of "Git"
m (github-clone) |
|||
Line 34: | Line 34: | ||
To jump between changes: {{Command|git-gutter:next-hunk}} or {{Command|diff-hl-next-hunk}}. | To jump between changes: {{Command|git-gutter:next-hunk}} or {{Command|diff-hl-next-hunk}}. | ||
+ | |||
+ | = Interfaces to github = | ||
+ | |||
+ | == Clone a github repo == | ||
+ | |||
+ | [https://github.com/dgtized/github-clone.el Github-clone] (in MELPA) is a project to clone a github repository. The command {{Command | github-clone}} will prompt for a repository and directory to clone to. In one shot, it will use the github api to fork the repo if you are not the owner, clone the repo to the specified directory, and add a remote called upstream if the repository is a fork. | ||
[[Category:Version Control]][[Category:Convenience]][[Category:Third Party Package]] | [[Category:Version Control]][[Category:Convenience]][[Category:Third Party Package]] |
Revision as of 15:21, 29 August 2014
Packages to interfere with the git version control system.
Full interfaces
Magit
Magit is a great Emacs mode for working with Git repositories. It provides a convenient interface for the most common Git operations. Please visit its own Magit page.
Specific use cases
Git blame
Git-blame is a package, available in ELPA, which provides a minor mode for incremental blame.
Show last commit message for current line
This package provides a function called git-messenger:popup-message that when called will pop-up the last git commit message for the current line. This uses the git-blame tool internally.
Available in ELPA.
Highlight uncommited changes
Git-gutter is an extension to highlight uncommitted changes on the left side of the window, indicating wether a line has been inserted, modified or deleted, and allowing you to jump between and revert them selectively. diff-hl does it too and works with Git, Mercurial, Bazaar and Svn, and it provides similar functionnality for dired. Both are available in ELPA. They are Tramp-aware.
After installation, call the minor modes or enable them:
(add-hook 'python-mode-hook 'git-gutter-mode)
Jump between changes
To jump between changes: M-x git-gutter:next-hunk or M-x diff-hl-next-hunk.
Interfaces to github
Clone a github repo
Github-clone (in MELPA) is a project to clone a github repository. The command M-x github-clone will prompt for a repository and directory to clone to. In one shot, it will use the github api to fork the repo if you are not the owner, clone the repo to the specified directory, and add a remote called upstream if the repository is a fork.