Skip to content

jyon124/enough-git-for-learn-co-chicago-web-051319

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Enough Git for Learn

Learn has a deep integration with Git and GitHub. We need to teach you just enough git to interact with GitHub like a real developer. It'll be easy, just watch the video below.

Topics Covered.

  1. Forking a repository GitHub.
  2. git clone to clone a repository to your local computer.
  3. git status to see the status of your locally cloned git repository.
  4. git add . to add your local changes to be committed.
  5. git commit -am "Commit Message" to commit changes that have been added with a message.
  6. git push to upload your local changes to GitHub.
  7. Opening a Pull Request on GitHub.

Summary

GitHub Fork

Forking is the process of making a personal copy of the Learn lab on GitHub. It's basically how you tell Learn that you have started working on a lab.

What's a Fork

To fork, just click the button on GitHub.

Fork on GitHub

Then select your personal GitHub account as the location to fork to.

Fork to Your Account

git clone

Cloning is the process of downloading a copy of the lab from your personal fork on GitHub to your computer.

What's a Clone

To clone, make sure you've first clicked on the SSH link (it starts with [email protected]: and not https://github.com, then click the copy button next to the Clone URL to copy it to your clipboard (you can also copy it by selecting the text and copying it to your clibpoard as you would normally).

The Clone URL

Next, in your Command Line (or Shell, or Terminal), navigate to the parent directory where you would like to place this lab. A good place would be in your Development directory within your home directory ~. You can change directory in your terminal by typing cd ~/Development.

To clone a lab, type git clone <the clone URL you copied from GitHub>

It would look something like this: git clone [email protected]:aviflombaum/first-lab-000.git

You should see [email protected], your username, like aviflombaum, and the lab you want to work on, like first-lab-000.

Type your clone command in your terminal and hit enter and you should see git download the lab to your computer.

git status

Once you have a git repository locally, git will keep track of every change you make to the code in that folder. You can ask git what the differences or changes you've made since the last commit by typing git status into your terminal.

It's really helpful to constantly get the status from git to see what changes you need to stage, add, commit, or push.

git add

Adding changes with the git add command is a way to stage any changes and get them ready to become a permanent record in your git log via a commit. The workflow worth memorizing right now is to simply add all your changes via git add ..

git commit

A commit is a permanent moment in time in your git history. A commit creates a new version of your code. To commit, memorize this command. git commit -am "Your commit message". You are using the git commit command with the flags -am, which tell git to commit all the changes and to include a commit message. You supply the commit message in "" directly in the command, `"Your commit message".

git push

Pushing is the process of taking your local code and commits and syncing them, or uploading them, to GitHub. You're updating the GitHub remote (remotes are just fancy names for copies of the repository), generally your fork, represented by a remote named origin, by pushing your code to the remote. The git command to do this is simply git push. When you git push from within a git repository, it will take all the commits that you have locally and push them to the online remote.

GitHub Pull Request

Submitting a pull request is how you submit your lab to be evaluated or graded on Learn.

What's a Pull Request

Creating a pull request is easy. You can do it entirely through the GitHub interface.

A. Click the green Pull Request button.

Opening a Pull Request

B. After reviewing the comparison code and making sure it shows your solution, click the Create pull request button.

Confirm Pull Request

C. Then click Create pull request button again.

Create Pull Request

Resources

GIT Cheatsheet

GIT Best Practices

Understanding the GitHub Flow

Hello World GitHub

Forking on GitHub

Git - The Simple Guide

Git Immersion

Try Git

View Enough Git for Learn on Learn.co and start learning to code for free.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published