Presentation is loading. Please wait.

Presentation is loading. Please wait.

Git Fundamentals Rochelle Terman 13 January 2014.

Similar presentations


Presentation on theme: "Git Fundamentals Rochelle Terman 13 January 2014."— Presentation transcript:

1 Git Fundamentals Rochelle Terman 13 January 2014

2 Game Plan 1.Introductions 2.Pedagogy + Plan: See one, do one, teach one 3.Set up: Sign up for Github, Install Git 4.Exercises 1.Pulling / Forking 2.Editing / Commits / Pushing 3.Tracking New Files 4.Fetch / Pull Requests / Collaboration 5.Discussion

3 3. Signup + Install 1.Go to www.github.com www.github.com 2.Sign up if you don’t already have an account 3.Go to help.github.com/articles/set-up-githelp.github.com/articles/set-up-git 4.Follow the instructions to install git 5.(Optional) Follow instructions to set up default email address (which should be the same as the email you used to sign up to github) 6.Test whether git is working by opening up bash/terminal and typing git

4 4.1 Forking / Cloning 1.Go to github.com/dlab-berkeley/git-fundamentalsgithub.com/dlab-berkeley/git-fundamentals 2.Fork it by clicking on the “Fork” button on the top right. 3.Open you bash and find your current directory by typing pwd (mac) or %CD% (windows) 4.Migrate to the directory you want to store your git rep by typing cd /path/to/my/git/directory 5.E.g. if you want the desktop, enter: cd ~/Desktop 6.Copy the git clone URL 1.Type git clone

5 4.1 Forking / Cloning Help pages: 1.Forking + Cloning: https://help.github.com/articles/fork-a-repo (steps 1 and 2) https://help.github.com/articles/fork-a-repo 1.Basic unix commands: http://guides.macrumors.com/Terminal#The_ current_directory http://guides.macrumors.com/Terminal#The_ current_directory 1.Basic windows commands: http://www.wikihow.com/Change-Directories- in-Command-Prompt http://www.wikihow.com/Change-Directories- in-Command-Prompt

6 4.2 Editing / Commits / Pushing 1.Open the README.md file in a text editor (not microsoft word) 2.At the bottom, type in your name followed by your favorite Simpson’s episode, like so: Rochelle: The one where they go to Australia 3.In bash/terminal, migrate to your git rep by typing cd git-fundamentals 4.Type git status 5.To commit, type: git commit –am “ ” 6.To push, type: git push 7.Go back to your forked repo on github and check out what happened.

7 4.2 Editing / Commits / Pushing Help pages: 1.Creating your own repo (with info on commits + pushing): https://help.github.com/articles/create-a- repo https://help.github.com/articles/create-a- repo 1.Git basics – changing a repo: http://git-scm.com/book/en/Git-Basics- Recording-Changes-to-the-Repository http://git-scm.com/book/en/Git-Basics- Recording-Changes-to-the-Repository

8 4.3 Tracking New Files 1.Create a new txt file and type “TEST” in it 2.Go back to bash/terminal and try to commit your changes. (what happens?) 3.Type git status and note what is says. 4.To add a file for tracking, type: git add or git add. 5.Now commit and push Help: Git basics – adding / ignoring / staging files: http://git-scm.com/book/en/Git-Basics-Recording-Changes-to- the-Repository http://git-scm.com/book/en/Git-Basics-Recording-Changes-to- the-Repository

9 4.4 Pull / Fetch 1.Go to the d-lab repo (the original repo) you forked and look at the code 2.Navigate to your repo branch and press the green “Compare” button 3.Review your changes and then click the header to submit the pull request 4.To update your local branch, use git pull or git merge Help: Pull Requests: https://help.github.com/articles/using-pull-requests https://help.github.com/articles/using-pull-requests Help: Fetch / merge / pull upstream changes: https://help.github.com/articles/syncing-a-fork


Download ppt "Git Fundamentals Rochelle Terman 13 January 2014."

Similar presentations


Ads by Google