I can only push changes to local repository

3k Views Asked by At

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...

1

There are 1 best solutions below

0
itstacotime On

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 [email protected]
$ 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 [email protected]:<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