1

Going through Daniel Kehoe's Learn Ruby on Rails book and I've installed and configured github on my macbook. My problem is that I'm not sure why my changes are only being committed and pushed to my local repository. They just won't show up on my github remote repos. Downloaded Github desktop for my mac and it works perfectly, pushes my changes that I make in my editor straight to my remote repository. Can't figure out where I went wrong with my configuration.

I make a small change to the ReadMe doc in my editor (Atom) and check the app git status in terminal. It reflects that the readme doc was changed. I then use the git add -A command and try to commit. It seems to work, after which I use the push command. It tells me everything is up to date, but when I check my remote repos, I see no changes...

Daniel Kehoe
  • 10,952
  • 6
  • 63
  • 82
karan satia
  • 307
  • 4
  • 16
  • 1
    `git push origin master`? – ceejayoz Mar 12 '15 at 14:22
  • hm. now when I use "git commit" I get the following message: # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Your branch is up-to-date with 'origin/master'. # # Changes to be committed: # modified: README.md # ~ -- INSERT -- When I add my message on top, I save the terminal command and...then what is supposed to happen? – karan satia Mar 12 '15 at 14:27
  • origin master also didn't do the trick... – karan satia Mar 12 '15 at 14:30
  • Please put the contents of `.git/config` in your question. – ceejayoz Mar 12 '15 at 14:30
  • just tried and was met with "permission denied" – karan satia Mar 12 '15 at 14:31

1 Answers1

2

let's walk through the git from the beginning. You should have performed an intial git set up which looks like this:

$ git config --global user.name "Your Name"
$ git config --global user.email your.email@example.com
$ git config --global push.default matching
$ git config --global alias.co checkout

You then initialize your repository:

 $ git init

Add the project files to the respository

 $ git add -A

then commit our initial repository changes

 $ git commit -m "Initialize repository"

Now we edit our readme file (some changes to readme) You commit your changes

$ git commit -am "Improve the README"

Then you add your remote repository, in this case it's bitbucket

$ git remote add origin git@bitbucket.org:<username>/sample_app.git

Lastly you push it to your remote repository

$ git push -u origin --all 

So it sounds like everything works well up to the readme commit, but your remote repository might not be set up. This all came from Hartl's Rails book Ch 1 and 3