Rails git conflict

rails
git

#1

I am trying to learn Ruby on Rails on a Windows 7 computer using Cloud9, which really simplified my life! Everything was working perfectly and I was able to create learn-rails my first app! The directory appears in Cloud 9 and the app works as expected.

I then created a github account, created my first repository called learn-rails. It worked, but my directory does not appear in the repository. I then tried the following two commands on my terminal within Cloud9:

git remote add origin https://github.com/berniekoenig/learn-rails.git
git push -u origin master

I get an error message indicating a conflict because the learn-rails repository already exists. I tried a pull request but I believe it expects the directory to be stored in my local computer, so it does not work!

Finally I tried downloading my project to my local computer from within Cloud9, the screen flashes but nothing really happens and I have no control over where to download my project? Any suggestions would be greatly appreciated. Thanx in advance, regards, Bernie


#2

Hi @berniekoenig

Did you successfully add the git remote?

In your Cloud 9 workspace terminal run:

git init

git remote add origin https://github.com/berniekoenig/learn-rails.git

This will create a new remote using your Github repository.

Check the status of your application’s files using:

git status

All your application’s files should be listed here as of now. Add these files to a new commit using:

git add --all .

Make a new commit:

git commit -m "COMMIT DESCRIPTION"

Push it to your repository’s master branch:

git push origin master

You will probably be asked for your Github credentials, enter them in the console.

Hope that works for you. Let me know if you are still having problems.