GithubHelp home page GithubHelp logo

git_training's Introduction

git_training

Getting Start With Git

Introduction To Git Presentation

The best way learn git is to use it. If you've never used git before, I recommend beginning with this short, interactive tutorial: Try Git

Now that you have some idea of what the commands are and the basic workflow, let's do some real world examples.

First some setup

Local Configuration

There are a lot of configuration options in git. The basics are listed below but you'll find you probably want to add more. -- Link to Configuration Options

git config --global user.name my name”
git config --global user.email “[email protected]

Setup a Github Account

Github is a hosting service for git repositories. Even if you don't use Github as your standard remote, I recommend setting up an account. Sign Up For Github

If you are a student, you are likely eligible for a free "Micro Plan". This gives you five private repositories for 2 years. Apply here.

Practice

Our practice will follow the Github Bootcamp, with a few modifications.

  1. Setup Git

    If you are using your lab computer, git is already installed (/usr/bin/git) and we've already taken care of the basic configuration, so you can skip to #2. If you are on another machine, installation is pretty easy and is outlined in the link above.

  2. Create A Repo

    Everyone needs a "Hello-World" repository. Follow the steps in the Create A Repo tutorial to create your own "Hello-World".

    If you are having trouble pushing to your Github repository check to make sure you are pushing to the ssh address, rather than https address. You will likely need to setup your ssh key here. Once you have your ssh keys setup, try pushing to the ssh repo address [email protected]:"$USER"/hello-world.git

    You can change the remote address using:

    git remote set-url origin [email protected]:"$USER"/hello-world.git

    Bonus: Now that you have that dialed, try repeating those steps for a project you've been working on.

  3. Fork A Repo

    Follow the steps in the tutorial to fork and clone the Spoon-Knife repo.

    The assignment

    a. Fork the git_traning, VIC, and DHSVM repositories.

    b. Now clone the your fork of the git_training repository to your local machine. i.e.:

    git clone [email protected]:"$USER"/git_training.git

    Note: If you get an ssh error when you try to clone or fetch, check out Github's tutorial on how to setup ssh keys.

    c. Create a branch your local copy of the repo, something like

    git branch joes-example-branch

    d. Checkout your branch

    git checkout joes-example-branch

    Note: c and d can be done as a single step as

    git checkout -b joes-example-branch

    e. Add a file to your repo (i.e. my_new_file.txt). The commands you'll need for this are:

    touch my_new_file.txt
    git add
    git commit # Don't forget a good commit message

    f. Push your changes to your Github fork.

    git push origin joes-example-branch

    e. Submit a pull request to UW-Hydro. This is done from your Github Repository Page.

  4. Be Social

    Not mandatory but you can follow an organization (e.g UW-Hydro) or a person (e.g jhamman if you want to stay tuned to ongoing developments on Github)

  5. GitHub Glossary

References and Links:

  • git-scm - Git's home page
  • Pro Git - Comprehensive book on using Git.
  • Github - Github home page
  • Git-Flow - This is the branching model and workflow that VIC and DHSVM and a good way to think about how branching can help you work more efficiently.

git_training's People

Contributors

dgergel avatar yifancheng avatar

Watchers

 avatar  avatar  avatar  avatar  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.