|
|
(2 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| OK. So recently I've made some modifications to code that is hosted on [https://github.com/ GitHub], as you can see in [https://github.com/jj5 my account]. I'm new and still learning the process, so here's what I've figured out:
| | This page has [https://www.progclub.org/wiki/John's_GitHub_page moved to ProgClub]... |
| | |
| == Fork the upstream repository into a project in your account ==
| |
| | |
| # go to [https://github.com/ GitHub]
| |
| # login
| |
| # navigate to the project repository you want to fork
| |
| # click 'Fork' on the top right
| |
| | |
| == Clone your fork ==
| |
| | |
| # open a terminal on your workstation
| |
| # change dir to your github directory (I use /home/jj5/repo/git/github/jj5)
| |
| # clone your fork (using SSH) with: git clone git@github.com/jj5/MyProject.git
| |
| | |
| == Make a topic branch in your fork ==
| |
| | |
| # open a terminal on your workstation
| |
| # change dir to your github fork (e.g. /home/jj5/repo/git/github/jj5/MyProject)
| |
| # create a branch with: git branch branch-name
| |
| # switch to your new branch: git checkout branch-name
| |
| | |
| Note: you can create a branch and check it out with one command: git checkout -b branch-name
| |
| | |
| Question: is 'switch' the correct verb for changing between branches?
| |
| | |
| == Make your changes ==
| |
| | |
| So edit files, add files, etc.
| |
| | |
| == Commit your changes on the topic branch ==
| |
| | |
| To commit your changes: git commit -a -m 'What you did...'
| |