When Github adds the README it commits it, and then this is the first commit. ĭownloading the README manually and adding and committing will probably produce a different commit ID, and put it at a different point in the commit history, which is why it's not detected as the same one.ġ) Why does it not work to initialize a remote repository on github with a README, and then try to connect the github repo with a previously existing existing local repo? You'll have to add the remote though, something like git remote add. If you've already got local changes or a local repo, you need to initialise an empty repository on Github, and then you can push. The errors are saying that your repo has changes that you don't have yet, because you added the README to the remote one when you set it up. How do I create a GitHub repository with an initialized README and connect it to a local repo without causing these errors? Why could I still not push and initialize the connection to my GitHub remote after I added the README from GitHub to my local repository manually? Why could I not pull when I tried to fix this error? Why does it not work to initialize a remote repository on GitHub with a README, and then try to connect the GitHub repository with a previously existing existing local repository? Hint: See the 'Note about fast-forwards' in 'git push -help' for details.ġ. Updates were rejected because the tip of your current branch is behind Master -> master (non-fast-forward) error: failed to push some refs to I couldn't pull the repository either, so I tried manually downloading, adding, and committing the README file I had created virtually and tried to push again, and got a new error: kirby:cs61as_SCIP_schython \**user**$ git push origin master 'Note about fast-forwards' in 'git push -help' for details. You may want to first merge the remoteĬhanges (e.g., hint: 'git pull') before pushing again. This is usually caused by another repository Updates were rejected because the remote contains work that you do Master -> master (fetch first) error: failed to push some refs to After trying to push, though, I get this error I don't fully understand: kirby:cs61as_SCIP_schython \**user**$ git push origin master I tried to create a GitHub repository using the instructions in the GitHub documentation, except instead of making a README locally, I initialized my GitHub repository with the README option.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |