Is there a way to run git commit
and git push
in the Atom editor?
I read this blog post but could not find that mentioned: http://blog.atom.io/2014/03/13/git-integration.html
Is there a way to run git commit
and git push
in the Atom editor?
I read this blog post but could not find that mentioned: http://blog.atom.io/2014/03/13/git-integration.html
What you're looking for is the git-plus package. Install that - it provides full Git integration with commands like commit
, add
, push
, pull
and lots of others.
ctrl
(or cmd
on mac) + shift
+ P
There've been some developments since this question was initially asked. Both git commit
and git push
(along with lotsa other commands) are now available in the app natively (version 1.18+).
There is a GUI for staging and reviewing changes as well as committing them with a commit message.
Just double-click to stage or un-stage files. Clicking on a file in Atom's Git GUI will load up the colored diff for reviewing changes. Type in a commit message right there in the text entry box and click the button to make the commit! Commit title's with message bodies (just a new line separating them) is supported - there's even a counter to let you know when your git commit message title is getting too long.
Also, when you have a change that's been staged and committed, you can push the contribution to your GitHub repository by pushing the down/up arrows at the bottom right to load up the options:
...then selecting the "Push" option:
Up goes your commits to the cloud!
Note as well that there is a branch display which can be used to switch branches or create new ones. Also, you can do pulls and fetching.
To stage new files and changes, and make a commit you also can access the git
tools from either the Packages Tab:
... or the View Tab:
A push will, of course, require your username and password.
Also, setting up the GitHub preview requires authentication:
ctrl+9 opens the "Git" pane
...and ctrl+shift+9 will close it.
ctrl+8 opens the "GitHub(preview)" pane
...and ctrl+shift+8 will close it.
One way to configure git
so you can bypass manually entering your username and password while using these Atom features:
Set your Git user info in the .gitconfig file.
On Windows this is usually located in your Users folder.
Example: If your username was Bob, your .gitconfig should be in: C:\Users\Bob.gitconfig
If this file doesn't exist, you need to create it and fill it out as followed:
(fill in the name and email part and save)
[user]
name = {NAME}
email = {EMAIL}
See also: https://help.github.com/articles/caching-your-github-password-in-git/
You can also use a git GUI package: git-control. It is easier to use and there is a small display of auto generated git commands, which is very helpful for beginners to get a good idea about git and version control.
There's also one more nice sweet package for commits: git-commit
.
Good news: it's super quick to commit all your stuff.
Bad news: it doesn't support pushing.
(source: github-camo.com)
In order to make the process more automatic, I have switched to another strategy to avoid having to click on too many buttons (am I lazy or it is worth the time?).
The idea is to create a small Makefile
file at the root of your project which would contain something like:
default: git
git:
git commit -am'Atom edits'
git push
I am then using the excellent build-make package to run that two commands in one key stroke <Cmd>-<Alt>-B
in my case.