Skip to content

nerdstein/marvel-movies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Learning Git workflows: Marvel Movies lesson

Demo for Juniata's IT-342 class. Made in memorial of Stan Lee.

This lesson is to be done with at least one peer to demonstrate remote Git workflows.

Lesson 1: preparation

On your system, please make sure you have Git installed on your system and a text editor of your choosing. Please configure your Github profile to use SSH keys.

Before starting the lessons, please load a terminal and Github. Email [email protected] with the Github usernames of those participating. I'll send an invite you will need to accept before assignment/merging is possible.

Lesson 2: cloning repositories

Repositories are self-contained. You can have one on your local and one that would be considered a "remote".

Github repositories are often remotes to local clones of the repository. By cloning, you automatically establish a connection to a remote repository.

On your system, run the following commands to clone to your local.

  1. Go to your home directory: cd ~
  2. Clone with git: git clone [email protected]:nerdstein/marvel-movies.git

You should now have a marvel-movies directory.

Lesson 3: issues

Making issues is a critical way to collaborate on improvements to projects.

On github, perform the following steps.

  1. Click on the issues tab of the repository
  2. Click on "New Issue" button
  3. Describe your proposed change and save

Lesson 4: working on an issue

  1. assign yourself an issue and note the issue number, e.g. 4
  2. on your local, make a new branch: git checkout -b issue-4 where 4 is the issue number
  3. perform the work described in the issue on your local
  4. commit the work: git commit -a -m "Issue 4: provide a description of your change
  5. verify the name of your remote repo: git remote -v, you should see origin
  6. push your work to a remote branch on Github: git push origin issue-4
  7. go to Github, you should see a "issue-4, compare and make pull request" message with a button

Lesson 5: reviewing an issue

  1. when you have an open a pull request, assign it to your peer to review by opening the pull request and clicking the "gear" next to "assign" on the right column
  2. have your peer review your change through the "pull requests" tab on github
  3. your peer should submit a review to accept or reject changes
  4. once approved, your peer should merge the pull request

While this link may have delays, you should see your change at this link.

Lesson 6: retrieving changes

Changes can be merged in at any time in the remote repository. It is best to frequently pull changes.

New changes

When you start working on a new issue, it's best to load the most recent change to avoid any remote conflicts.

  1. Load the default master branch on your local: git checkout master
  2. Fetch all changes from remotes: git fetch --all
  3. Synchronize your local master with the remote branch: git reset --hard origin/master

Loading changes before merging

Changes to the upstream branch can happen while you are working on your changes. This often means changes cannot be merged when a pull request is made.

  1. Have your peer merge a change while you are working on an issue on your local system
  2. Commit your changes: git commit -a -m "Issue 4: describe your work"
  3. Fetch all changes from remotes: git fetch --all
  4. Rebase on the remote master branch: git rebase origin/master, note: this can be tricky if changes are made to the same files.
  5. You may need to force push your rebase since the log of commits changed: git push origin issue-4 --force

About

Demo for Juniata's IT-342 class

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages