Changing your online repositiory from another computer
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.Wha开发者_StackOverflow社区t 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 'git@github.com: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.
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.
Use
git pull origin master
to update it to the latest version.
Then try recommit your changes.
I imagine you're having problems with your SSH key.
Make sure you carefully follow the instructions on Github:
- Linux
- Windows (msysgit)
For more information, have a look at the section on this in the Pro Git book.
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
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 'git@github.com: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.
精彩评论