I have forked a private repository (an iPhone project) as follows:
cd nameofdirectory
git init
git clone forkedURL
Now I want to push the changes done by me to my forked repository so that the main admin can review my written code and merge it with the main repository.
How can I push the changes done by me to my forked repository using terminal on MacOS?
You can’t push into other people’s repositories. This is because push permanently gets code into their repository, which is not cool.
What you should do, is to ask them to pull from your repository. This is done in GitHub by going to the other repository and sending a “pull request”.
There is a very informative article on the GitHub’s help itself: https://help.github.com/articles/using-pull-requests
To interact with your own repository, you have the following commands. I suggest you start reading on Git a bit more for these instructions (lots of materials online).
To add new files to the repository or add changed files to staged area:
To commit them:
To commit unstaged but changed files:
To push to a repository (say
origin):To push only one of your branches (say
master):To fetch the contents of another repository (say
origin):To fetch only one of the branches (say
master):To merge a branch with the current branch (say
other_branch):Note that
origin/masteris the name of the branch you fetched in the previous step fromorigin. Therefore, updating your master branch from origin is done by:You can read about all of these commands in their manual pages (either on your linux or online), or follow the GitHub helps: