How to Use GitHub and Atom: The GitHub web interface is a good place to start editing your code, especially if you only need to make a few changes or add a few files to your repo. But if you change or add many files to your repo, the web interface will feel very slow. We suggest that you download two free tools GitHub Desktop and Atom Text Editor to speed up your work.
These tools can be used on either a Mac or a Windows computer. When you connect your GitHub web account to GitHub Desktop, you can “pull” the latest version of the code to the hard drive of your local computer, make changes and test them, and then “push” your changes back to your GitHub web account.
Atom Text Editor, which was made by the same people who made GitHub, makes it easier to view and edit code repositories on your own computer than the GitHub web interface. Even though coders can use many different text editors, Atom is made to work well with GitHub Desktop.
Steps to Use GitHub and Atom
- Go to http://www.github.com and create an account by clicking the ‘Sign up‘ button on the top right.
- Create a Repository (project): You can Read the guide or Start a project directly:
- Copy the Clone/Download URL
- git clone the URL (If you don’t have git installed, check this post from Chris Chernoff explaining how to go about it).
- Download the Atom editor from www.Atom.io, then install and start the application.
- In the Atom editor, write your python code and save the file to the repository folder using a .py extension. In this example, we will use the filename “ucs-config.py“
- If the atom-runner package is installed, you could execute the code directly from Atom pressing CTRL-R on your keyboard.
- Go back to the command line (Terminal) and execute the following commands:
- Execute “git add ucs-config.py” and “git status” again
- Execute “git commit -m “message” “
- At this point, the new file is committed to the project in my laptop, but not synced up.
- Execute “git push“
- If this was your first time pushing a file, execute “git config –global push.default simple” to get rid of the legacy message.
- Everyone else who wants to have the latest revision of your project must execute a “git pull” if they already cloned the project or the “git clone URL” command to download the whole project.
- All these git commands work when you are in the repository path/folder of your laptop, use the “pwd” command to check your current path.
- Execute git with no arguments to display the Help:
FAQ
How to use Atom and Git?
Once you open Atom, you can right-click in the project pane on the left and choose to Add Project Folder. Choose your now synchronized repository. You can then edit or create new files in that folder. These changes will show up when you hit save as an unstaged change.
How do I checkout from GitHub in Atom?
Open the Atom command palette and search for git checkout checkout (requires Git checkout plugin having been installed). You may also open the checkout dialog directly using the hotkeys ctrl + alt + shift + c (or ctrl + opt + shift + c on Mac). The checkout dialog is a list of branches to checkout or switch to.