Giter Club home page Giter Club logo

git-github's Introduction

General Assembly Logo

Git and Github

Objectives

  • Manage change in a project.
  • Collaborate over time and space.
  • Fork a repository.
  • Clone a repository
  • Synchronize repositories locally.
  • Synchronize repositories remotely.

Prerequisites

Overview

Continuing with what we started Git Basics we are going to use Github to manage our project.

Demo: Linking with GitHub

So we have a local repository, watch as I create a GitHub repository. Why GitHub? So we can backup our code online. It also provides us with a useful graphical interface and useful collaboration features.

Now create your own GitHub repository and push your master branch.

Lab: More Pushing

The last time we saw Ned Stark we had just written his fate. Below his story write the beggining of another character's story. For instance:

Joffrey Baratheon was the one to do Ned in, but his story was only about to being, and let me assure you he will DEFINITELY NOT DIE!

Push the changes you made.

Also push your dream-story branch. We pushed our master branch with the command git push origin master. Can you figure out how to push our dream-story branch?

Demo: Adding to Your Story

Watch as I fork and clone one of your repos and make an addition by creating a pull request.

Lab: Adding to Other's Stories

Working with a partner follow my example and take turns adding to one another's stories. Accept each other's pull requests. After you've each gone once stop.

Pulling: Updating Your Local

Each of you should now have updated code on GitHub, but your local Git repo will be behind. We need to get the latest code off of GitHub. We can do this by pulling the changes that we merged. The command to do this is:

git pull origin master

This get the latest copy of our code off of the master branch of our original repository.

Remotes

A remote repository is just another repository that you are connected to and depending on your permission you can push code up to it and pull code down from it.

Watch as I add a remote from one of your repositories then update my local with the changes. You will be asked to do this next.

git remote add upstream <"[email protected]/"> is the command to add a remote called upstream. It's just as easy to pull from it.

Adding Your Own Remote

Working with the same partner from before one of you will be the primary repository, the other will be a contributor.

  1. The contributor will add the primary repository as a remote.

  2. The primary will push their latest story to the master branch.

  3. The contributor will pull the master branch from the primary.

  4. The contributor will add to the story and push their changes to their own repository and create a pull request to the primary.

  5. The primary will accept the pull request and pull the changes to their local.

  6. The primary will add to the story and push the changes to their master branch.

7.The primary and the contributor will go back and forth adding to the story.

Editing on GitHub

Hey! See that little pencil button on the top of a page on github!? That looks to change text and will help us, right?! [Edit Pencil Wrong! DON'T EVER USE THAT! Regardless of how small changes are you typically never want to edit ON GitHub. You always want to make changes locally and push them. The reason we never want to do that is if you edit in the cloud, our local repo and GitHub repo become out of sync and it breaks convention.

References

  1. All content is licensed under a CC­BY­NC­SA 4.0 license.
  2. All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact [email protected].

git-github's People

Contributors

bengitscode avatar micfin avatar payne-chris-r avatar realweeks avatar tdyer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.