I usually used the Intellij IDEA to edit code but lately I have been testing out Atom from Github. I was wondering if there was any way to display Git blame in the editor. Intellij dose it by right clicking on the line number and clicking "annotate".
Summary. The git blame command is used to examine the contents of a file line by line and see when each line was last modified and who the author of the modifications was. The output format of git blame can be altered with various command line options.
The GitHub package brings Git and GitHub integration right inside your editor! Now you can switch or create branches, stage changes, commit, pull and push, resolve merge conflicts, view and checkout pull requests and more.
Clone repositories To clone a repository, open the GitHub panel while you have no project folders open in Atom and click "Clone an existing GitHub repository". In the dialog, paste the URL of a repository and click "Clone". The new project will be added to the Tree View.
Toggle git-blame annotations in Atom. Use ctrl-b to activate blame. Alternatively, right click the file you want to blame and select Toggle Git Blame from the dropdown. Click on the revision hash in the gutter to visit the configured repository diff site.
The default execution of git blame will simply output the commands help menu. For this example, we will operate on the README.MD file. It is a common open source software practice to include a README file in the root of a git repository as documentation source for the project.
If a previous author has modified the spacing of a file by switching from tabs to spaces or adding new lines this, unfortunately, obscures the output of git blame by showing these changes. The -M option detects moved or copied lines within in the same file.
Unlike git blame and git annotate in older versions of git, the extent of the annotation can be limited to both line ranges and revision ranges. The -L option, which limits annotation to a range of lines, may be specified multiple times.
I just released a new package which renders the line’s author and date in the status (bottom) bar:
https://atom.io/packages/atom-status-bar-blame
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With