Closed charnpreetsingh closed 8 years ago
Thanks! I will keep that in mind for next time. One problem I came across was that Github would not let me do a pull request when I cloned the repository. However, when I forked it, I was able to do a pull request. Why is that?
Great question @charnpreetsingh185.
The simple answer is that you do not have privileges sufficient to directly push to the repo. Instead, you must fork the project which is your copy of the project on GitHub, Gitlab, Bitbucket.
For common language let's define a few things:
git remote -v
is a handy command. It tells you what remote repositories are named.
git remote ...
is the command that will allow you to name and rename the nicknames that you give for repos and their locations.
You can add a fork to your existing local repo. Basic steps:
git remote -v
You should see origin pointing at jupytercalpoly/team-spiritcharnpreetcharnpreetsingh185/team-spirit
forked from jupytercalpoly/team-spirit
git remote -v
should still have origin pointing to jupyercalpoly/team-spiritCool! Now we want to update what the remotes are named and the URL for the remotes. Let's start by renaming the existing origin remote to upstream:
git remote rename origin upstream
Running git remote -v
, the only remote that exists is upstream. Great that's what we want.
Now skim the GitHub doc here (basically look at the pictures).
Now let's get the URL for the charnpreet185/team-spirit
repo. Click the green download/clone box's arrow:
You will want to use the URL https://.... link if you have not yet set up your ssh. Otherwise click 'use SSH' to get the URL.
On the command line, execute:
git remote add origin <URL>
Now you should have two remotes: origin
and upstream
. Let's check with git remote -v
.
Let's push your local contents to the origin
repo (your GitHub fork of the upstream repo):
git push origin master
Success!
Nicely done @charnpreetsingh185 aka Charmander. Happy to merge this PR.
In future PRs you will want to begin getting in the habit of developing on a branch:
or
It will save you merge headaches later.
Good job. 📱 🔐