Changes

Jump to navigation Jump to search
48 bytes added ,  17:38, 4 June 2023
Line 129: Line 129:  
   <li><u>Adding a repository from your local computer to GitHub</u><br>
 
   <li><u>Adding a repository from your local computer to GitHub</u><br>
 
       &ensp; 1) On your local computer, initialize the folder you want to adds as a repository:<br>
 
       &ensp; 1) On your local computer, initialize the folder you want to adds as a repository:<br>
       &ensp; &ensp; - <b>cd</b> to the folder that contains the work you'd like to track/backup<br>
+
       &ensp; &ensp; - Use <b>cd</b> to navigate to the folder that contains the work you'd like to track/backup<br>
       &ensp; &ensp; - type <b>git init</b> to initialize the folder for Git tracking<br>
+
       &ensp; &ensp; - Type <b>git init</b> to initialize the folder for Git tracking<br>
       &ensp; &ensp; - type <b>touch .gitignore</b> to create a blank file in that folder, which can later be modify to specify files or types of files you don't want to track (<i>optional step</i>)<br><br>
+
       &ensp; &ensp; - Type <b>touch .gitignore</b> to create a blank file in that folder, which can later be modify to specify files or types of files you don't want to track (<i>optional step</i>)<br><br>
    
       &ensp; 2) Go to https://github.com/ , login, and create a repository as described above. Name the repository the same as your working folder you did the git init command in<br><br>
 
       &ensp; 2) Go to https://github.com/ , login, and create a repository as described above. Name the repository the same as your working folder you did the git init command in<br><br>
    
       &ensp; 3) On your local computer link your working folder to the GitHub repsoitory:<br>
 
       &ensp; 3) On your local computer link your working folder to the GitHub repsoitory:<br>
       &ensp; &ensp; - <b>git remote add origin <i>github-repository-url</i></b><br>
+
       &ensp; &ensp; - Type <b>git remote add origin <i>github-repository-url</i></b><br>
 
       &ensp; &ensp; &ensp; &ensp; <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  
 
       &ensp; &ensp; &ensp; &ensp; <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><br>
 
                                     address into the line of code above<br><br>
    
       &ensp; 4) On your local computer, merge the two repositories (local and online):<br>
 
       &ensp; 4) On your local computer, merge the two repositories (local and online):<br>
       &ensp; &ensp; - <b>git pull origin main</b><br>
+
       &ensp; &ensp; - Type <b>git pull origin main</b><br>
 
       &ensp; &ensp; &ensp; &ensp; This assumes the GitHub branch is named <i>main</i> in the repository you created online<br><br>
 
       &ensp; &ensp; &ensp; &ensp; This assumes the GitHub branch is named <i>main</i> in the repository you created online<br><br>
       
       &ensp; 5) On your local computer, add files to track:<br>
 
       &ensp; 5) On your local computer, add files to track:<br>
       &ensp; &ensp; - <b>git add .</b><br><br>
+
       &ensp; &ensp; - Type <b>git add .</b><br><br>
    
       &ensp; 6) On your local computer, commit that add:<br>
 
       &ensp; 6) On your local computer, commit that add:<br>
       &ensp; &ensp; - <b>git commit -m "Message here"</b><br>
+
       &ensp; &ensp; - Type <b>git commit -m "Message here"</b><br>
 
       &ensp; &ensp; &ensp; &ensp; Change <i>Message here</i> to a brief description of the reason for the commit (ex: Initial commit). Make sure to keep ""<br><br>
 
       &ensp; &ensp; &ensp; &ensp; Change <i>Message here</i> to a brief description of the reason for the commit (ex: Initial commit). Make sure to keep ""<br><br>
    
       &ensp; 7) On your local computer, change (if required) the branch name to the name listed in the online repository:<br>
 
       &ensp; 7) On your local computer, change (if required) the branch name to the name listed in the online repository:<br>
       &ensp; &ensp; - <b>git branch</b> tells you the name(s) of the branch(es) with the current one having a * next to it<br>
+
       &ensp; &ensp; - Typing <b>git branch</b> tells you the name(s) of the branch(es) with the current one having a * next to it<br>
 
       &ensp; &ensp; - 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>
 
       &ensp; &ensp; - 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>
 
       &ensp; &ensp; - Use <b>git branch</b> to verify the change<br><br>
 
       &ensp; &ensp; - Use <b>git branch</b> to verify the change<br><br>
    
       &ensp; 8) On your local computer, push your commit:<br>
 
       &ensp; 8) On your local computer, push your commit:<br>
       &ensp; &ensp; - <b>git push -u origin main</b><br>
+
       &ensp; &ensp; - Type <b>git push -u origin main</b><br>
 
       &ensp; &ensp; &ensp; &ensp; You'll need to enter your GitHub profile name and your Personal Access Token to complete the push<br><br>
 
       &ensp; &ensp; &ensp; &ensp; You'll need to enter your GitHub profile name and your Personal Access Token to complete the push<br><br>
  
581

edits

Navigation menu