How to get github integration working?

I am brand new to Atom and brand new to Github. Never used Git before either. I’ve been trying to get Github integration working in Atom for 8 hours now, to no avail. I’ve searched this forum, I’ve googled, I’ve watched youtube videos, I’ve perused the git command line reference, and I still do not have this working. I’ve gotten close a few times, but changes never end up on Github. I know noob questions like mine can be annoying, but boy I am just at my wit’s end here.

Here is what I’d like to do:
I’ve got a Github repository with two files in it. The repository is called “foo”, and the files are fileA.txt and fileB.txt. I do not currently have any branches besides master. What I’d like to do is get all of these files to my local machine, edit them in Atom, and after I’m done making changes I’d like to use Atom to have those changes reflected on Github.

I’ve tried using the Github “clone or download” button, followed by some combination of clicking “create repository” in Atom along with command line commands. I’ve also tried starting out from the command line, and doing a “git clone”. Nothing seems to work.

(note: I have done the two command prompt commands to let git know my username and email addr.)

Basically what I’m looking for here is a list of steps including the explicit command line commands that I need to perform to get this working. Here is one example that did not work (there were many many others):

  1. github.com - choose the respository and the branch
  2. github.com - click “clone or download” | “download zip”
  3. open the zip, and copy the contents to my local machine. Since the repo is named “foo” and my branch is master, the folder with the files ends up being named “foo-master”.
  4. Atom - File | “add project folder”, and select the “foo-master” folder.
  5. Atom - open the git panel and click “Create Repository”
  6. Command Prompt - change to the “foo-master” folder
  7. Command Prompt - “git remote add origin /* here is where the URL goes */

At this point my 2 files both show up in Atom with green plus marks in the Git panel under “unstaged changes”. I would also point out that down at the bottom of the git panel the blue button says “create detached commit”. I go ahead and modify one of the files. I click “stage all”, enter a commit message, and click “create detached commit”. Now checking github, those changes aren’t there, but let’s continue. I change a file in Atom again. It now shows up with a red or orange icon in the git panel, and the button at the bottom now reads “commit to master”. I stage all, enter commit msg, click “commit to master”, and still no changes end up on github. Now I go to the github panel and click “publish and open new pull request” and I get a red “push rejected” error.

Thanks to anyone who can give me the exact list of steps I need to perform here.

Atom should just work with a git repo that has a correct remote. If you use the clone functionality (in Atom or with git clone), you won’t need to add a remote yourself.

What happens when you try to commit from the command line? The steps are as follows:

  1. Make changes in your files.
  2. Run git add . in the command prompt.
  3. Run git status and post the results here (make sure to select them and click the </> button above the editor to format them as code for enhanced readability).
  4. Run git commit -m "Pushing the day away" && git push.

I believe that your issue is caused by the newly created repository not having its upstream branch properly set. The origin remote is sufficient to run git status and git pull, but there’s a specific setting that tells where to push. If this is the case, what you want to do (after you step through that checklist and get an error when you try to push) is run git push --set-upstream origin master.

Here’s a great comprehensive tutorial on using integrating Git and Atom: https://youtu.be/Ov8cVSzz_lE