git_introduction
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| git_introduction [2018/11/14 23:47] – [git status] tell | git_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: | Before doing anything, sign up with github (create a username and password, and find the Eastbots organization: | ||
| + | |||
| 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:// | + | We found a good windows download here https:// |
| ====== Git basics, Steve' | ====== Git basics, Steve' | ||
| Line 23: | Line 24: | ||
| git clone https:// | git clone https:// | ||
| to put a copy of the pcboards-2018 tree onto your own computer. | to put a copy of the pcboards-2018 tree onto your own computer. | ||
| + | |||
| + | Here's a screenshot showing the complete process. | ||
| + | {{ :: | ||
| ===== 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. | The pull command updates your local repository and working copy with new changed made and pushed to the parent repository on github. | ||
| + | |||
| + | Unless you only did your clone seconds ago, someone else on the team may have submitted changes since you cloned. | ||
| + | |||
| + | ===== aside: your first edit ===== | ||
| + | |||
| + | Exercise: | ||
| + | * Clone the Team-4795/ | ||
| + | * find the file gitplay/ | ||
| + | * 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 " | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Some editors will run right in the terminal, others will start up a new window in which they can support | ||
| + | menus and mouse actions. | ||
| + | |||
| + | {{ : | ||
| ===== git status ===== | ===== git status ===== | ||
| Line 31: | Line 53: | ||
| {{ : | {{ : | ||
| In white is my prompt, where I typed the '' | In white is my prompt, where I typed the '' | ||
| + | |||
| + | Exercise: | ||
| + | * do the edit shown above, either from the command line or from a graphical file manager | ||
| + | * open a terminal and find the team-git-practice-file again | ||
| + | * run "'' | ||
| + | |||
| + | |||
| ===== git add ===== | ===== git add ===== | ||
| When you've made a worthwhile change (say adding a new function or component), use "'' | When you've made a worthwhile change (say adding a new function or component), use "'' | ||
| + | |||
| + | Exercise: | ||
| + | * find team-git-practice-file again; the file that you changed above | ||
| + | * stage your change by running: | ||
| + | |||
| + | git add team-git-practice-file | ||
| + | |||
| ===== git commit ===== | ===== git commit ===== | ||
| Line 38: | Line 74: | ||
| for you to type in a commit message describing what you changed. | for you to type in a commit message describing what you changed. | ||
| Good commit messages help your teammates (and you) understand why the program or design was changed. | Good commit messages help your teammates (and you) understand why the program or design was changed. | ||
| - | + | {{ :git-commit-editor.png? | |
| - | (screenshot of editor plus commit | + | |
| On linux, the text editor that git starts for the commit message can be changed with the $EDITOR environment variable. | On linux, the text editor that git starts for the commit message can be changed with the $EDITOR environment variable. | ||
| Line 49: | Line 84: | ||
| The last step in doing a useful addition to a project is to push it up to github so the world (and your teammates) can see it. Type "'' | The last step in doing a useful addition to a project is to push it up to github so the world (and your teammates) can see it. Type "'' | ||
| - | The only way I know to avoid typing in your github password with every commit is to do your initial clone using ssh, and also create and upload your ssh public key to github. | + | The only way I know to avoid typing in your github password with every commit is to do your initial clone using ssh, and also create and upload your ssh public key to github. |
| + | {{ : | ||
| + | Exercise: | ||
| + | * Run '' | ||
| + | * Look at https:// | ||
| Line 66: | Line 104: | ||
| ====== References ====== | ====== References ====== | ||
| + | * https:// | ||
| * official git documentation and tutorial: https:// | * official git documentation and tutorial: https:// | ||
| * another tutorial https:// | * another tutorial https:// | ||
git_introduction.1542257226.txt.gz · Last modified: 2018/11/14 23:47 by tell
