Changes

Jump to navigation Jump to search
349 bytes added ,  14:41, 31 May 2023
Line 42: Line 42:  
           <li>You can do the same for your home computer, you'll just need to open a terminal or command prompt and navigate to the directory where you want to store your code</li>
 
           <li>You can do the same for your home computer, you'll just need to open a terminal or command prompt and navigate to the directory where you want to store your code</li>
 
         </ul>
 
         </ul>
       <li><u>Type the command:</u><br> <b>git clone https&#58;&#47;&#47;github&#46;com&#47;your-username&#47;your-repository&#46;git</b><br> <i>make sure to replace "your-username" with your GitHub username and "your-repository" with the name of your repository</i></li>
+
       <li><u>Type the command:</u><br> <b>git clone https&#58;&#47;&#47;github&#46;com&#47;your-username&#47;your-repository&#46;git</b><br> <i>&ensp; - Make sure to replace "your-username" with your GitHub username and "your-  
 +
            repository"  
 +
            with the name of your repository</i></li>
 
       <li>You will now need to login. Use your <b>GitHub Username</b>, but make sure to use the <b>Personal Access Token</b> you created earlier and <b><u>NOT</u></b> your GitHub password</li>
 
       <li>You will now need to login. Use your <b>GitHub Username</b>, but make sure to use the <b>Personal Access Token</b> you created earlier and <b><u>NOT</u></b> your GitHub password</li>
 
     </ul><br>
 
     </ul><br>
Line 56: Line 58:  
   <li>To switch to or determine a branch in Git, you can use the git checkout command:
 
   <li>To switch to or determine a branch in Git, you can use the git checkout command:
 
     <ul>
 
     <ul>
       <li>Determine the name of the branch you want to switch to via:<br> <b>git branch</b><br> It will show all branches available and indicate your current branch with a * <br></li>
+
       <li>Determine the name of the branch you want to switch to via:<br> <b>git branch</b><br>  
       <li>Create a new branch using: <br> <b>git branch new-branch-name</b> then use <b>git checkout new-branch-name</b> to switch to that branch and work in it<br> OR <br> <b>git checkout -b new-branch-name</b> will create and switch to the new branch in one step</li><br>
+
          <i>&ensp; - It will show all branches available and indicate your current branch with a * </i><br></li>
 +
       <li>Create a new branch using: <br>  
 +
          <b>git branch new-branch-name</b> </li>
 +
      <li>Switch to that branch and work in it via:<br>
 +
          <b>git checkout new-branch-name</b> <br></li><br>
 +
      <li>The two steps above can be combined:<br>  
 +
          <b>git checkout -b new-branch-name</b> <br>
 +
          &ensp; <i>- This will <b>create and switch</b> to the new branch in one step</i></li><br>
 
     </ul>
 
     </ul>
   Line 64: Line 73:     
<!-- Step 8 -->
 
<!-- Step 8 -->
   <li>When you're ready to save, make sure you are in the root directory of your repository or the directory where the new folder you want to save is located. Then use the git add command to add the new folder and its contents to the staging area. Run the following command:<br> <b>git add folder-name</b><br> OR <br> <b>git add .</b> <br>  If you want to add all new files and folders in the current directory</li><br>
+
   <li>When you're ready to save, make sure you are in the root directory of your repository or the directory where the new folder you want to save is located. Then use the git add command to add the new folder and its contents to  
 +
      the staging area. Run the following command:<br>
 +
  <b>git add folder-name</b><br>  
 +
  &ensp; OR <br>
 +
  <b>git add .</b> <br>  If you want to add all new files and folders in the current directory</li><br>
 +
https://github.com/git-guides/git-add
    
<!-- Step 9 -->
 
<!-- Step 9 -->
Line 72: Line 86:  
   <li>After committing the changes (on your local machine), you can push them to the remote repository on GitHub using the git push command:<br> <b>git push origin branch-name</b><br> Replace <i>branch-name</i> with the name of the branch you want to push to (e.g., main)<br> You will need to login with your Username and Personal Access Token</li><br>
 
   <li>After committing the changes (on your local machine), you can push them to the remote repository on GitHub using the git push command:<br> <b>git push origin branch-name</b><br> Replace <i>branch-name</i> with the name of the branch you want to push to (e.g., main)<br> You will need to login with your Username and Personal Access Token</li><br>
 
</ol>
 
</ol>
 +
 +
 +
<!-- For spacing      &nbsp; OR <br>
 +
  &ensp; OR <br>
 +
  &emsp; OR <br> -->
581

edits

Navigation menu