tags:

views:

99

answers:

5

Hello,

I created an online repository on GitHub.com.
I was adding/removing/modifying files on that repository normally from a computer I was using.

Now, I am using a different computer and I do not have the original local repository that was stored on the other computer I was using.
So, I created a folder whose name is the same as the name of the repository and I put the files inside that folder along with git of-course.

What I wanted to do is to modify my online repository but I have problems in doing that.
Mainly that i could not push.
Git gives an error back which I could not resolve. I searched online on how to resolve the problem.
Of-course I found solutions but non-of them worked.
What one should do in-order to modify an an online repository form another computer?


Edit:
I do not have a problem with the ssh-key.
I had a problem but I resolved it by creating a new ssh-key. here is the error:

! [rejected] master -> master (non-fast forward) error: 
failed to push some refs to '[email protected]:me/me.git'  
To prevent you from losing history, non-fast-forward updates were rejected  
Merge the remote changes before pushing again.  
See the 'non-fast forward' section of 'git push --help' for details.
A: 

I imagine you're having problems with your SSH key.

Make sure you carefully follow the instructions on Github:

For more information, have a look at the section on this in the Pro Git book.

Skilldrick
A: 

I dont know why you didn't clone your repository on first place, but you must add your public keys to github before push anything. Check this

Mauricio
A: 

hi,

i do not have a problem with the ss-key. I had a problem but i resolved it by creating a new ssh-key. here is the error:

! [rejected] master -> master (non-fast forward) error: failed to push some refs to '[email protected]:me/me.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes before pushing again. See the 'non-fast forward' section of 'git push --help' for details.

But as I have said.. i could not resolve it.

Thank you.

Muaz Al-Jarhi
You appear to be new here, so I'd like to point out that it's better to edit your question to add extra information (there's a small grey link near the lower left corner of your question that says "edit"), instead of posting an answer to your own question. VonC has already done this for you, but in the future, that will make it easier for people to find all of the information in your question.
Brian Campbell
Could you please delete this "answer"? I took the liberty to edit your question and add your error message to it. Read also http://meta.stackoverflow.com/questions/21788/how-does-editing-work-in-stack-overflow
VonC
+4  A: 

From your description of the error message, it sounds like you need to do a "git pull" before doing a "git push". Because the Github repository has some changes that you don't yet have in your local repository, you must merge those changes into your local repository before pushing your new changes to Github.

Greg Hewgill
I would agree with this solution. +1
VonC
+1. Or just get your working copy with git clone from github to begin with and you're good to go.
calmh
+1  A: 

Use

git pull origin master

to update it to the latest version.

Then try recommit your changes.

Macha