GIT Homework
Due Oct 30.
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.
You will manage the code state with "commit", "push", "pull", "clone", and "fetch" operation.
The process works as follows.
- A project is created on Github.
- Init a git repository in a project (git init)
- Add the files to the local repository (git add .)
- Commit the files to the new repository (git commit)
- Other gets the code into their private repository and code base (git clone)
- Team members work on code and test locally. (use textwrangler and notepad++, make, and test)
- Individuals commit work (git commit)
- Individuals pull to get any changes in main repository (git pull)
- Individuals may have to merge changes in main repository with local changes.
- 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
- All of the team members will create GitHub
accounts.
- One of the team members will create a new GitHub
project (public) in their avcount called ShakeProject.
- The same team member will turn their Project 1 into a Git project. This will push the project to the GitHub
repository.
- The other members will be invited to the project. To invite click settings, and then collaborators. Enter in member names to send an invitation.
- The other teams members accept membership
- The other students will clone the new github into their directory. They will enter "git clone github-project-url"
- Each team member should make some minor changes to different files (perhaps in the code comments).
- Each student should commit the changes for the files changed: git commit _file_
- Then do a pull to merge in any repository changes: git pull
- Then do a push to save changes to the repository: git push
- Check the files in your personal directory to see if everyones changes are there.
- Each student should make minor changes to different parts of the same file.
- Each one should do a commit, push, pull to to save and reconcile the differences as needed.
- Everyone should check the results
Working from
GitHub
- Go to the github.com site. Log in. Notice how you can edit the code, and commit
- Click the history button on a file that has changes. Look at the history in Unified nd Split modes.
- You can now use GitHub
for you editor instead of Notepad++ or textwranger if you choose.
Turn in
A short lab report answering:
- What are the purposes of Git?
- What is github versus git?
- What problems did you experience in this lab?
- How you resolved the problems given above?
- how could this lab be better?
- A link to your github account
References
Review the following as needed. Remember you can ignore things relating to INSTALLING and REMOTES.
Topic revision: r16 - 2019-10-25
- JimSkon