Tags:
create new tag
view all tags

GIT Homework

Due February 28.

Moodle

Goal

For this classes we will use GIT to track our projects on the GitHub server. GitHub is free for public processes, but costs money for (about $7.00 a month) for private projects. It is assumed your projects will be public, but you are free to make them private is you wish to. However, the instructor must have access to all class related projects for grading purposes.

Overview

Git is typically used for a group to synchronize their activities. to do this there is a common repository server that everyone pushes to and pulls from, and sometimes merges with. We will be using GitHub as our repository. GitHub is an online repository that alows groups of people to work on a project together, allowing them to work on and synchronize their work. It also keeps a complete history of ALL versions of every file in the project. In this class all groups are required to create an use a repository for group projects. You will sent your project name to the instructor so the project can be monitored.

GIT1.png

You will manage the code state with "commit", "push", "pull", "clone", and "fetch" operation.

The process works as follows.

  1. A project is created on Github.
  2. Init a git repository in a project (git init)
  3. Add the files to the local repository (git add .)
  4. Commit the files to the new repository (git commit)
  5. Other gets the code into their private repository and code base (git clone)
  6. Team members work on code and test locally. (use textwrangler and notepad++, make, and test)
  7. Individuals commit work (git commit)
  8. Individuals pull to get any changes in main repository (git pull)
  9. Individuals may have to merge changes in main repository with local changes.
  10. Indiviiduals do a push to update master (git push)

Goal

You will work with your team to create a GIT repository on the server using project 3. Then set it up at GitHub. Finally your other teammates and you will experiment with using this GitHub repositroy from several accounts.

Steps

  1. All of the team members will create GitHub accounts.
  2. One of the team members will create a new GitHub project (public) in their avcount called ShakeProject.
  3. The same team member will turn their Project 1 into a Git project. This will push the project to the GitHub repository.
    • On github click "Start a project", enter in the name.
    • Go to the project on cslab.
    • Delete any old project git files (in case you started from my nameserver project) using "rm -rf .git".
    • Go back to the newly created project on github. You will see a set of commands under the heading "…or create a new repository on the command line" that look somthing like:
      echo "# exampleproject" >> README.md git init git add README.md git commit -m "first commit" git remote add origin https://github.com/expertlearningsystems/exampleproject.git git push -u origin master
      Copy and paste this into the command line while in the project 1 directory. You will need to log into gih hub.

    • If you get a message "Please tell who you are", copy the commands and put in your username and email.
    • Do a "make clean" to remove object files.
    • Do a "git add *" to add everything to the project
    • Do a "git commit *" to commit to github. You will need to type in a comment into the editor, and hit control-o, return, control-x.
    • Do a "git push" to push the files to github. you will need to enter your gitghub credentials.
  4. The other members will be invited to the project. To invite click settings, and then collaborators. Enter in member names to send an invitation.
  5. The other teams members accept membership
  6. The other students will clone the new github into their directory. They will enter "git clone github-project-url"
  7. Each team member should make some minor changes to different files (perhaps in the code comments).
  8. Each student should commit the changes for the files changed: git commit _file_
  9. Then do a pull to merge in any repository changes: git pull
  10. Then do a push to save changes to the repository: git push
  11. Check the files in your personal directory to see if everyones changes are there.
  12. Each student should make minor changes to different parts of the same file.
  13. Each one should do a commit, push, pull to to save and reconcile the differences as needed.
  14. Everyone should check the results
Working from GitHub
  1. Go to the github.com site. Log in. Notice how you can edit the code, and commit
  2. Click the history button on a file that has changes. Look at the history in Unified nd Split modes.
  3. You can now use GitHub for you editor instead of Notepad++ or textwranger if you choose.

Turn in

A short lab report answering:

  1. What are the purposes of Git?
  2. What is github versus git?
  3. What problems did you experience in this lab?
  4. How you resolved the problems given above?
  5. how could this lab be better?
  6. A link to your github account

References

Review the following as needed. Remember you can ignore things relating to INSTALLING and REMOTES.

  • GIT1.png:
Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng GIT1.png r1 manage 38.2 K 2017-02-22 - 11:03 JimSkon  
Edit | Attach | Watch | Print version | History: r13 < r12 < r11 < r10 < r9 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r13 - 2018-02-27 - JimSkon
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback