Changes between Version 2 and Version 3 of cs222p-2018-fall-git


Ignore:
Timestamp:
Sep 26, 2018, 5:10:31 PM (7 years ago)
Author:
Qiushi Bai
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • cs222p-2018-fall-git

    v2 v3  
    44
    55 1. Each student creates a github account, and shares his/her github username with the CS222P staff on this [https://docs.google.com/spreadsheets/d/1hI49H-dG-GV_EAd4yfqUkdAapZJ1a1vY5Uy46FN9rpg/edit#gid=1065497958 spreadsheet].
    6  1. The staff will send each of them an invitation to join the [https://github.com/UCI-Chenli-teaching UCI-chenli-teaching] organization. Both accept the invitation and are added to the organization.
    7  1. One team member, say Bob, needs to create a  '''private''' (default setting) repository called '''cs222p-fall18-team-99''' (naming format is "cs222p-fall-team-xx" where "x" is your assigned team number.) on Github.com within organization '''UCI-chenli-teaching'''.
     6 2. The staff will send each of them an invitation to join the [https://github.com/UCI-Chenli-teaching UCI-chenli-teaching] organization. Both accept the invitation and are added to the organization.
     7 3. One team member, say Bob, needs to create a  '''private''' (default setting) repository called '''cs222p-fall18-team-99''' (naming format is "cs222p-fall-team-xx" where "x" is your assigned team number.) on Github.com within organization '''UCI-chenli-teaching'''.
    88 * 1) Go to [https://github.com/UCI-Chenli-teaching UCI-Chenli-teaching organization].
    99 * 2) Click the '''New''' button to create a repository.
     
    1111 * 3) Type in the name and choose '''private'''.
    1212[[Image(wiki:cs222p-2018-fall-git:create-repo-interface.png)]]
    13  1. Bob also needs to add the other member Alice to the repository as a collaborator (by following steps given [https://help.github.com/articles/inviting-collaborators-to-a-personal-repository/ here]).
     13 4. Bob also needs to add the other member Alice to the repository as a collaborator (by following steps given [https://help.github.com/articles/inviting-collaborators-to-a-personal-repository/ here]).
    1414
    15 == Using Git:
     15== Initializing Git repo with our codebase:
    1616
    17  1. On his local machine, Bob installs a Git client by following the instructions [https://git-scm.com/book/en/v2/Getting-Started-Installing-Git here].
    18  1. He then does the following:
    19 
     171. On his local machine, Bob installs a Git client by following the instructions [https://git-scm.com/book/en/v2/Getting-Started-Installing-Git here].
     182. He then does the following:
    2019{{{
    2120shell> mkdir mycs222p-projects
    2221shell> cd mycs222p-projects
    23 shell> git init
    24 shell> echo "Cool project" > README.md          - creates a README file
    25 shell> git status          - check the status of the repository
    26 shell> git add README.md          - The file is initially untracked by Git. 'git add' moves it to staged.
    27 shell> git status           - check the status of the repository after staging the file
    28 shell> git commit -m "First Commit"          - The staged files are committed locally.
    29 shell> git status          - check the status of the repository after committing the file
     22shell> git clone https://<Bob's username>@github.com/UCI-Chenli-teaching/cs222p-fall18-team-99.git     - Clone the repository you just created to your local machine
     23shell> cd cs222p-fall18-team-99/
     24shell> git pull https://github.com/UCI-Chenli-teaching/cs222p-fall18.git master --allow-unrelated-histories    - Pull our project codebase to your local machine and merge it to your local "cs222p-fall18-team-99" repository
    3025}}}
    31  3. The local repository now has to be linked to the remote repository. For that Bob does the following:
     26Now git will open `vim` automatically for you to edit comments for this merging operation
     27{{{
     28Just type ":q" will use default message and complete the merging operation.
     29}}}
     30Now you will see something like this:
     31{{{
     32From https://github.com/UCI-Chenli-teaching/cs222p-fall18
     33 * branch            master     -> FETCH_HEAD
     34Merge made by the 'recursive' strategy.
     35 .gitignore/.gitignore |  32 ++++++++++++++++++++
     36 makefile.inc          |   8 +++++
     37 project1_report.txt   |  23 +++++++++++++++
     38 rbf/makefile          |  49 +++++++++++++++++++++++++++++++
     39 rbf/pfm.cc            |  88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
     40 rbf/pfm.h             |  52 +++++++++++++++++++++++++++++++++
     41 rbf/rbfm.cc           |  47 +++++++++++++++++++++++++++++
     42 rbf/rbfm.h            | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     43 rbf/rbftest1.cc       |  50 +++++++++++++++++++++++++++++++
     44 rbf/rbftest10.cc      | 144 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     45 rbf/rbftest11.cc      | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     46 rbf/rbftest12.cc      | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     47 rbf/rbftest2.cc       |  46 +++++++++++++++++++++++++++++
     48 rbf/rbftest3.cc       |  62 +++++++++++++++++++++++++++++++++++++++
     49 rbf/rbftest4.cc       |  92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     50 rbf/rbftest5.cc       |  96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     51 rbf/rbftest6.cc       | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     52 rbf/rbftest7.cc       | 144 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     53 rbf/rbftest8.cc       | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     54rbf/rbftest8b.cc      | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     55 rbf/rbftest9.cc       | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     56 rbf/test_util.h       | 281 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     57 readme.txt            |  20 +++++++++++++
     58 23 files changed, 2064 insertions(+)
     59 create mode 100644 .gitignore/.gitignore
     60 create mode 100644 makefile.inc
     61 create mode 100644 project1_report.txt
     62 create mode 100644 rbf/makefile
     63 create mode 100644 rbf/pfm.cc
     64 create mode 100644 rbf/pfm.h
     65 create mode 100644 rbf/rbfm.cc
     66 create mode 100644 rbf/rbfm.h
     67 create mode 100644 rbf/rbftest1.cc
     68 create mode 100644 rbf/rbftest10.cc
     69 create mode 100644 rbf/rbftest11.cc
     70 create mode 100644 rbf/rbftest12.cc
     71 create mode 100644 rbf/rbftest2.cc
     72 create mode 100644 rbf/rbftest3.cc
     73 create mode 100644 rbf/rbftest4.cc
     74 create mode 100644 rbf/rbftest5.cc
     75 create mode 100644 rbf/rbftest6.cc
     76 create mode 100644 rbf/rbftest7.cc
     77 create mode 100644 rbf/rbftest8.cc
     78 create mode 100644 rbf/rbftest8b.cc
     79 create mode 100644 rbf/rbftest9.cc
     80 create mode 100644 rbf/test_util.h
     81 create mode 100644 readme.txt
     82}}}
     83Now you already have the whole code base merged to your local repository
     84{{{
     85shell> git push          - Push the updated local repository to your remote "cs222p-fall18-team-99" repository
     86}}}
     87Now you will see something like this:
     88{{{
     89Counting objects: 31, done.
     90Delta compression using up to 4 threads.
     91Compressing objects: 100% (29/29), done.
     92Writing objects: 100% (31/31), 14.95 KiB | 3.74 MiB/s, done.
     93Total 31 (delta 11), reused 0 (delta 0)
     94remote: Resolving deltas: 100% (11/11), done.
     95To https://github.com/UCI-Chenli-teaching/cs222p-fall18-team-99.git
     96   3e7e4d2..f51d097  master -> master
     97}}}
     98Now it means your remote "cs222p-fall18-team-99" repository has all the code in our codebase, and it's ready for you and your partner to work on the project based on that now!
    3299
    33 {{{
    34 shell> git remote add origin git@github.com:UCI-Chenli-teaching/cs222p-fall18-team-99.git
    35 shell> git push -u origin master
    36 }}}
    37  4. Bob now wants to start on project 1. He creates a new branch from the master branch for this task.
     100== Using Git to collaborate on this project:
     101
     102 3. Bob now wants to start on project 1. He creates a new branch from the master branch for this task.
    38103
    39104{{{
     
    47112shell> git push --set-upstream origin bob-feature1            - creates a remote tracking branch for the local bob-feature1 branch
    48113}}}
    49  5. Alice wants to contribute too. First Bob needs to invite Alice as a contributor to this repository on the Github web site.  Then she can see the repository. She does the following:
     114
     115 5. Alice wants to contribute too. First Bob needs to invite Alice as a contributor to this repository on the Github web site (by following steps given [https://help.github.com/articles/inviting-collaborators-to-a-personal-repository/ here]).  Then she can see the repository. She does the following:
    50116
    51117{{{