User Tools

Site Tools


git_introduction

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
git_introduction [2018/11/15 00:03] – [git push] tellgit_introduction [2018/11/16 16:47] (current) ilena
Line 6: Line 6:
  
 Before doing anything, sign up with github (create a username and password, and find the Eastbots organization: https://github.com/Team-4795. Before doing anything, sign up with github (create a username and password, and find the Eastbots organization: https://github.com/Team-4795.
 +
 Once you have a github account, Amr, Steve, or Ilena can add you to the Eastbots organization in github. Once you have a github account, Amr, Steve, or Ilena can add you to the Eastbots organization in github.
  
Line 11: Line 12:
  
 If you're using linux, git should be available easily with the software package manager in your linux system. If you're using linux, git should be available easily with the software package manager in your linux system.
-We found a good windows download here https://git-scm.com/download/win  (Ilena, is this the one we put on yoru computer?)+We found a good windows download here https://git-scm.com/download/win  
  
 ====== Git basics, Steve's version ====== ====== Git basics, Steve's version ======
Line 23: Line 24:
     git clone https://github.com/Team-4795/pcboards-2018.git     git clone https://github.com/Team-4795/pcboards-2018.git
 to put a copy of the pcboards-2018 tree onto your own computer.   Get the link to the existing repository from the green "clone or download" button in the repository's github page.  to put a copy of the pcboards-2018 tree onto your own computer.   Get the link to the existing repository from the green "clone or download" button in the repository's github page. 
 +
 +Here's a screenshot showing the complete process.  We change into a folder (directory) that already exists called Eastbots, and run "ls" only to find that it is an empty folder.  Then we do the clone, and ls again.  We see that a new directory called pcboards-2018 has been created.
 +{{ ::git-clone-pcboards.png?400 |}}
  
 ===== git pull ===== ===== git pull =====
 The pull command updates your local repository and working copy with new changed made and pushed to the parent repository on github.  Simply type "''git pull''" The pull command updates your local repository and working copy with new changed made and pushed to the parent repository on github.  Simply type "''git pull''"
 +
 +Unless you only did your clone seconds ago, someone else on the team may have submitted changes since you cloned.  Run ''git pull'' early and often to stay up to date!
 +
 +===== aside: your first edit =====
 +
 +Exercise:
 +  * Clone the Team-4795/pcboards-2018 repository  (see git clone above)
 +  * find the file gitplay/team-git-practice-file that was copied to your computer
 +  * Using a text editor (like textedit, notepad, emacs, or vim), add one new line to the file that contains at least your name.  Do not use word or any other word processor to edit these plain-text files.
 +
 +These screenshots show what you'll see.  Use "cd" to change into the pcboards-2018 directory, and ls to list the files there.  Then cd into the gitplay directory (folder).  Running ls there shows that there's a file called team-git-practice-file there.  This is the file we want, so we run our text editor on that file.
 +
 +{{ :git-cd-editfile.png?400 |}}
 +
 +Some editors will run right in the terminal, others will start up a new window in which they can support
 +menus and mouse actions.  That can look like this:
 +
 +{{ :git-editfile-emacs.png?300 |}}
  
 ===== git status ===== ===== git status =====
Line 33: Line 55:
  
 Exercise: Exercise:
-  * Clone the Team-4795/pcboards-2018 repository  (see git clone above) +  * do the edit shown above, either from the command line or from a graphical file manager 
-  * find the file gitplay/team-git-practice-file that was copied to your computer +  * open a terminal and find the team-git-practice-file again 
-  * Using a text editor (like textedit, notepad, emacs, or vim), add one line to the file with your name +  * run "''git status''" as shown above.
-  * run "''git status''" as shown here+
  
  
Line 83: Line 104:
  
 ====== References ====== ====== References ======
 +  * https://www.youtube.com/watch?v=boeCjJKg-LY&t=0s&list=PLUSdSy9CkwBIiISFMa_ThWmtFCKtYLUE_&index=6 - Eastbots programming video focusing on git 
   * official git documentation and tutorial: https://git-scm.com/book/en/v2/Getting-Started-Git-Basics   * official git documentation and tutorial: https://git-scm.com/book/en/v2/Getting-Started-Git-Basics
   * another tutorial https://product.hubspot.com/blog/git-and-github-tutorial-for-beginners   * another tutorial https://product.hubspot.com/blog/git-and-github-tutorial-for-beginners
  
git_introduction.1542258232.txt.gz · Last modified: 2018/11/15 00:03 by tell