Git Error : 'upstream' does not appear to be a git repository

后端 未结 5 1457
感动是毒
感动是毒 2021-01-31 14:06

I\'m very new to Git, so facing some issues with it correct usage. Here is my scenario.

I have a fork of my master repository and cloned it into my local. In that, I hav

5条回答
  •  借酒劲吻你
    2021-01-31 14:25

    Here are the steps I followed today to solve that same problem

    The steps below will enable you to link your git fork and the original repository so that you can pull changes from the original repository anytime it's updated. Go to the repository's page on github and click on fork (if you haven't done so already). Assuming you forked a repo called repo-name from https://github.com/account/repo-name then you get a copy (fork) of the repo on your own account under something like https://github.com/your-user-name/repo-name Then run the commands below on your terminal

    • git clone https://github.com/your-user-name/repo-name.git
      
    • cd repo-name
      
    • git remote add upstream https://github.com/account/repo-name.git
      
    • git pull upstream master
      
    • git branch --set-up-stream-to=upstream/master
      
    • git pull
      

    When you make changes and wish to integrate it the original codebase, in order to add your changes to the original repo, you have to push to your fork first on github and send a pull request which will then be verified and merged to the codebase. Steps below.

    • git add .
      
    • git commit -m "commit message"
      
    • git push origin master
      

    Then visit your account on github and click on your repo-name. On the page, you'll see a link to create pull request. Click on the link and create pull request which will then be reviewed and merged by the maintainer.

提交回复
热议问题