git - How to use terminal commands with Github? -
i have forked private repository (an iphone project) follows:
cd nameofdirectory git init git clone forkedurl
now want push changes done me forked repository main admin can review written code , merge main repository.
how can push changes done me forked repository using terminal on macos?
you can't push other people's repositories. because push permanently gets code repository, not cool.
what should do, ask them pull repository. done in github going other repository , sending "pull request".
there informative article on github's itself: https://help.github.com/articles/using-pull-requests
to interact own repository, have following commands. suggest start reading on git bit more these instructions (lots of materials online).
to add new files repository or add changed files staged area:
$ git add <files>
to commit them:
$ git commit
to commit unstaged changed files:
$ git commit -a
to push repository (say origin
):
$ git push origin
to push 1 of branches (say master
):
$ git push origin master
to fetch contents of repository (say origin
):
$ git fetch origin
to fetch 1 of branches (say master
):
$ git fetch origin master
to merge branch current branch (say other_branch
):
$ git merge other_branch
note origin/master
name of branch fetched in previous step origin
. therefore, updating master branch origin done by:
$ git fetch origin master $ git merge origin/master
you can read of these commands in manual pages (either on linux or online), or follow github helps:
- https://help.github.com/articles/create-a-repo commit , push
- https://help.github.com/articles/fork-a-repo fetch , merge
Comments
Post a Comment