# start alice 1004 cd alice/ # clone repository 1005 git clone git@gitlab.cs.washington.edu:bdmyers/talk.git 1006 cd talk/ # notice that there is a .git directory 1007 ls -a # "login" as alice (bash prompt and commit messages) 1006 source ../login_as_alice.sh # Alice first adds the existing talk files 1008 wget http://courses.cs.washington.edu/courses/cse374/15wi/lectures/talk/make_demo.tar 1009 tar xvf make_demo 1011 mv make_demo/* . 1012 rmdir make_demo; rm make_demo.tar 1015 git add main.c 1016 git add shout.c 1017 git add shout.h 1018 git add speak.h speak.c Makefile 1019 git status 1020 git commit -m "new project: talk" # Push the commit to the origin remote 1021 git push -u origin master # Now see them in gitlab; now bob can also pull these files from origin # Demo: Alice and Bob change different parts of the code. # Git does a merge that can complete automatically. # Alice changes Makefile 1084 vim Makefile 1085 git add Makefile 1086 git commit -m "added clean target to make" # (Meanwhile, Bob changes speak.c # and Bob pushes) # Alice pushes, but it is rejected 1087 git push # She must first pull; git does a merge and it completes automatically 1088 git pull 1089 git push # Demo: Alice and Bob change the same line concurrently 1120 vim main.c # edit line 12 1121 git add main.c 1122 git commit -m "changed speak message" 1123 vim main.c 1124 git log 1125 git push # Alice pushed first so succeed 1131 history > alice.history