Skip to content

hilava/learn-git

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

Learn Git Lab

  1. Create a fork of the learn-git repository by clicking "Fork" on the top right.

screen-shot-2015-10-20-at-17 26 49

  1. You'll see a screen like this while GitHub is forking the repo. Forking creates a copy of the original repo on your own GitHub account.

screen-shot-2015-10-20-at-17 21 15-1

  1. Now you have your own copy of the repo! Copy the "clone URL" from the top.

screen-shot-2015-10-20-at-17 22 43

  1. Make a wdi directory. This is where you will put all your work from this class.
➜ mkdir ~/wdi
  1. Use the "clone URL" to clone the repo onto your local machine. Make sure you're in your ~/wdi directory before you clone!
cd ~/wdi
➜  git clone <clone-url>
  1. Change directories into the repo you just cloned (in this example, learn-git).
cd learn-git
  1. Open this project in Atom.
atom .
  1. Back in Atom, open index.html. In the <body> tags, create an <h1> tag with your name and add a gif of your liking in an <img> tag. "Copy Image Address" from giphy.com.

  2. Now that you've changed the repo, it's time to commit your changes. Back in your terminal, type

➜  git status

This shows you the files that have been modified, created, or deleted. Notice that they are listed as untracked.

  1. Now you're ready to add your changes. Type
➜  git add .

Then git status. Notice that your new file has gone from untracked to Changes to be committed.

  1. Next step is committing. Type
➜  git commit -m "modifying index.html"

Then git status. Notice that the new status is Your branch is ahead of 'origin/master' by 1 commit.. This indicates that your the version of the repo on your computer (aka the local version) includes your changes but the version hosted by GitHub (aka the remote version) does not.

  1. To get your changes on to the remote version of the repo, type
➜  git push origin master

Now git status will tell you that Your branch is up-to-date with 'origin/master'. !!!

  1. Once you're done with the assignment and have committed and pushed ALL of your changes to GitHub, it's time to make a pull request back to the original repo. Go to your forked copy of the repo on GitHub, and click the "Pull Request" button.

screen-shot-2015-10-20-at-17 25 24

  1. GitHub takes you to a new view and asks if you want to create the pull request. Click the green button, and that's it - you've now created a pull request to submit this lab!

screen-shot-2015-10-20-at-17 25 49

  1. Repeat! Add some new content to your file and repeat this Git flow.

About

Day 1 Learn Git Basics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 100.0%