Line 127: |
Line 127: |
| | | |
| <!-- 3 --> | | <!-- 3 --> |
− | <li>Adding a repository from your local computer to GitHub<br> | + | <li><u>Adding a repository from your local computer to GitHub</u><br> |
|   1) On your local computer, initialize the folder you want to adds as a repository:<br> | |   1) On your local computer, initialize the folder you want to adds as a repository:<br> |
|     - <b>cd</b> to the folder that contains the work you'd like to track/backup<br> | |     - <b>cd</b> to the folder that contains the work you'd like to track/backup<br> |
Line 138: |
Line 138: |
|     - <b>git remote add origin <i>github-repository-url</i></b><br> | |     - <b>git remote add origin <i>github-repository-url</i></b><br> |
|         <i>github-repository-url</i> can be found online. In your repository folder click on the green [<> Code] button then under the Local tab you'll see Clone HTTPS. Click the copy button to paste the | |         <i>github-repository-url</i> can be found online. In your repository folder click on the green [<> Code] button then under the Local tab you'll see Clone HTTPS. Click the copy button to paste the |
− | address into the line of code above<br> | + | address into the line of code above<br><br> |
| | | |
|   4) On your local computer, merge the two repositories (local and online):<br> | |   4) On your local computer, merge the two repositories (local and online):<br> |
Line 150: |
Line 150: |
|   6) On your local computer, commit that add:<br> | |   6) On your local computer, commit that add:<br> |
|     - <b>git commit -m "Message here"</b><br> | |     - <b>git commit -m "Message here"</b><br> |
− |         Change <i>Message here</i> to a brief description of changes (ex: Initial commit). Keep ""<br><br> | + |         Change <i>Message here</i> to a brief description of the reason for the commit (ex: Initial commit). Make sure to keep ""<br><br> |
| | | |
− |   7) On your local computer, make sure/change the branch name to the name listed in the online repository:<br> | + |   7) On your local computer, change (if required) the branch name to the name listed in the online repository:<br> |
|     - <b>git branch</b> tells you the name(s) of the branch(es) with the current one having a * next to it<br> | |     - <b>git branch</b> tells you the name(s) of the branch(es) with the current one having a * next to it<br> |
− |     - If you need to modify your local computer's branch name use <b>git branch -M main</b> where <i>main</i> is the name to change it to<br><br> | + |     - If you need to modify your local computer's branch name use <b>git branch -M main</b> where <i>main</i> is the name to change the branch to<br> |
− |         Use <b>git branch</b> to verify change<br><br> | + |     - Use <b>git branch</b> to verify the change<br><br> |
| | | |
|   8) On your local computer, push your commit:<br> | |   8) On your local computer, push your commit:<br> |
|     - <b>git push -u origin main</b><br> | |     - <b>git push -u origin main</b><br> |
− |         You'll need to enter your GitHub profile name and your Personal Access Token<br><br> | + |         You'll need to enter your GitHub profile name and your Personal Access Token to complete the push<br><br> |
| | | |
| + |   9) At this point your online GitHub repository should be the same as the working folder on your local computer.<br> |
| + |   You can now continue to code and push/pull to GitHub as needed to track/update changes. Good luck, if it doesn't work don't blame me ... I only work here :) <br> |
| | | |
| </li> | | </li> |