CSCI 2134 辅导、 写作program语言程序

” CSCI 2134 辅导、 写作program语言程序CSCI 2134 Lab 1: Using GitWinter 2021ObjectiveIn this lab, you will apply your knowledge of version control, notably Git, to manage a set of filesfor a project. You will be given a Git repository of a project and will be asked to perform severalchanges to the files in the project.Aside: The code in question comes from a sequence of assignments that students were assignedin CSCI 3136, which involved writing an interpreter for a small language. This lab is intended tobe a simulation of these assignments. You will be given all the intermediate source files and willbe adding them to the project as if you were writing it yourself. That is, the following lab representsthe set of steps students would need to do to store and manage their assignments in Git.PreparationIt is STRONGLY recommended that You complete Task 1 of Assignment 1 prior to this lab.Ensure that your CSID is active and you can log into your GitLab account at httpss://git.cs.dal.ca.If not, please see instructions in Assignment 1 to accomplish this. All work will be done in the CSGitLab server. Do not use an external Git service like GitHub.Ensure that you have read and understood the material on version control and Git from thecourse. You might also gain some insights through an online Git tutorial, like the one at httpss://try.github.io.ResourcesSupport files: httpss://git.cs.dal.ca/courses/2021-winter/csci-2134/lab1/lab1-support-files.gitProcedureSet-up1. Open a command-line window (Terminal on a Mac or gitbash on Windows)2. Create the Directory where you would like to store a local copy of Lab 1. e.g.,mkdir git/csci2134/lab_1The above assumes that you have already created a git directory in your home directoryand a csci2134 directory inside the git directory.3. Change directories to where you would like to store a local copy of Assignment 1, e.g.,cd git/csci2134/lab_14. Clone the repository for lab 1 supporting files repository, which you will need for the lab.Use the following command and Git URL:git clone httpss://git.cs.dal.ca/courses/2021-winter/csci-2134/lab1/lab1-support-files.gitA directory called lab1-support-files will be created. Ensure that it contains the followingsubdirectories, each with files in them:v1 splatlex.pyv2 splatparse.pyv3 splat.py splateval.pyv4 splat.py splatred.pyv5 splat.py splatlambda.pyv6 splat.py splatselect.pyv7 splat.py splatuard.py5. Clone the repository for your lab 1 using the following command and Git URLgit clone httpss://git.cs.dal.ca/courses/2021-winter/csci-2134/lab1/????.gitwhere ???? is your CSID. A directory with the same name as your CSID will be created,containing Lab 1 code.6. Change directories into the cloned lab 1 repository, where ???? is your CSID.cd ????Part 1: Accessing the History of a Project7. Checkout (switch to) a branch called incremental:git checkout incrementalYou will see a directory called incremental, which will contain a file called splat.py.8. Check to ensure you are on the right branchgit statusYou will should see a Message of the formOn branch incrementalnothing to commit, working tree cleanYou should use git status regularly to confirm the branch and files you are working on.9. Create a temporary text file outside of the local repository (e.g., on your Desktop) to recordanswers to the following questions:a. How many versions of splat.py have been committed on this branch? Use the commandgit log to view all commits and the following command to view just all commits ofthe specific filegit log — incremental/splat.pyb. For each of the Commits, what was the date and the commit comment?c. Which class was added to splat.py before the current version? Use the command:git diff HEAD^ — incremental/splat.pyNote: HEAD refers to the tip of the branch; HEAD^ refers to the previous commit, andHEAD^^ refers to the commit before that, etc.d. How many lines of code was the first commit of incremental/splat.py (scanner)?Hint: to move to a previous commit you can use the commandgit checkout HEAD^Repeating this command will move you to the preceding commit. The commandgit checkout incrementalreturns you to the tip of branch. To count the number of lines, simply load the file intoan editor.10. Return to the main branchgit checkout mainNotice that the incremental directory has vanished and that a file called answers.txthas appeared in the lab 1 directory. Use git status to confirm that you are on themain branch.11. Record the answers to the questions in the answers.txt file. Record also your nameand banner number to make the markers life easier.12. Prepare to Commit the changes you made to answers.txt. This is called staging:git add -A13. Check to ensure that the file has been stagedgit statusThe modified files should be listed.14. Commit the changesgit commit -m Added answers to Part 1 of the labNote: the -m switch allows you to specify a commit comment on the command line. If it isnot provided, an editor will be invoked for you to add a commit comment.15. Push the changes back up to the repositorygit push origin mainPart 2: Basic OperationsWhenever we make changes to a code-base, the recommended procedure is to (i) branch thecode-base, (ii) make the changes in the branch, merge the branch back into the main branchonce you are satisfied with them. Hence, the motto: branch often and commit early. For thesecond part of the lab we will do this a few times to practice our skills. Note: that the first timewe commit in a repository, we can commit on the main branch.16. Create a src subdirectory in the lab 1 directory (same location as answers.txt):mkdir src17. Copy the files from the lab1-support-file/v1 to src18. Add (Stage), check status, commit, and push the changes, like in steps 12 15The rest of the lab involves simulating the development of the code:19. Create a branch from the main branch called development:git branch development20. Switch to the development branch, similar to steps 7 821. Copy the files from the lab1-support-file/v2 to src.22. Add and commit the changes, with a suitable commit message23. Repeat steps 21 and 22 with the files in v3, v4, v5, v6, and v7 directories. If you were doingthis over the span of several days, step 23 would also be done for each version, ensuringyour code is backed up on a remote server.24. Push the development branch to the repositorygit push -u origin developmentHaving finished (and presumably tested) the code, we now merge it back to the main branch25. Switch to the main branch (like in step 10)26. Merge the Development branch into the main branchgit merge development27. Push the main branch to the repository (like in step 15)28. Log in to the git web interface and check that your files were added, committed and pushedsuccessfully: httpss://git.cs.dal.ca/courses/2021-winter/csci-2134/lab1/????.git29. Youre done!GradingThe lab will be marked out of 4 points:Task 2 Points 1 Point 0 PointsTask1All questions are answeredin answers.txt. Answersare mostly correct.The file answers.txthas been modified andcontains some answers.The file answers.txthas not Been modified,Task2The commit and merge historyis mostly correct.Some of the Commits andmerges have been done.No evidence of any commitsor merges.如有需要,请加QQ:99515681 或WX:codehelp

添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导