• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Introduction to git and github
 

Introduction to git and github

on

  • 3,669 views

Basic Introduction to Git and Github. Covers the basic work flow of init, clone, add, commit and push. Other commands like git remote, git pull etc are briefly touched.

Basic Introduction to Git and Github. Covers the basic work flow of init, clone, add, commit and push. Other commands like git remote, git pull etc are briefly touched.

Statistics

Views

Total Views
3,669
Views on SlideShare
3,098
Embed Views
571

Actions

Likes
3
Downloads
99
Comments
0

27 Embeds 571

http://geekabyte.blogspot.com 236
http://geekabyte.blogspot.nl 106
http://geekabyte.blogspot.in 98
http://geekabyte.blogspot.de 22
http://geekabyte.blogspot.co.uk 18
http://geekabyte.blogspot.ro 14
http://geekabyte.blogspot.fr 12
http://geekabyte.blogspot.it 9
http://geekabyte.blogspot.ca 7
http://geekabyte.blogspot.com.au 6
http://geekabyte.blogspot.com.br 6
http://geekabyte.blogspot.com.es 6
http://geekabyte.blogspot.jp 6
http://geekabyte.blogspot.mx 5
http://geekabyte.blogspot.gr 3
http://geekabyte.blogspot.co.nz 3
http://feeds2.feedburner.com 2
http://geekabyte.blogspot.fi 2
http://geekabyte.blogspot.tw 2
http://geekabyte.blogspot.hu 1
http://geekabyte.blogspot.se 1
http://geekabyte.blogspot.ch 1
http://geekabyte.blogspot.cz 1
http://geekabyte.blogspot.no 1
http://geekabyte.blogspot.co.at 1
http://geekabyte.blogspot.com.ar 1
http://translate.googleusercontent.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Introduction to git and github Introduction to git and github Presentation Transcript

    • Introduction to Git and Github Dade’ Aderemi http://geekabyte.blogspot.com
    • What is Git and Github git Git is an extremely fast, efficient, distributed version control system used for collaborative development of software. Git was designed and developed by Linus Torvalds. git·hub Github is a web-based hosting service for software development projects that use the Git revision control system. Github was founded by chris wanstrath and tom preston-werner and PJ Hyett.
    • FlowInstallingConfiguring Git with GithubWorking locally with GithubWorking remotely with Github
    • Installing Git Installing Git is simple. Download and follow the steps of installation. Find detailed installations: Linux http://help.github.com/linux-set-up-git/ Windows http://help.github.com/win-set-up-git/ OSX http://help.github.com/mac-set-up-git/
    • Configuring Git with GitHUB Github makes using Git a lot cooler. Steps to have your Git installed to work with Github is as follows: 1. Generate SSH Key 2. Add SSH Key to Github 3. Setting up preference and info 4. Testing
    • Configuring Git with GitHUB Generate SSH Key To generate a new SSH key, enter the code below. Press Enter to go with the default settings. Now you need to enter a passphrase.
    • Configuring Git with GitHUBPassphrase is another layer that makes you SSH key more secure. Youshould see something like this. And a id_rsa.pub file would be created inyour working directory.
    • Configuring Git with GitHUB Add SSH Key To Github Create an account on www.github.com. Login, go to “Account Settings” > Click “SSH Keys” > Click “Add another public key” Open the id_rsa.pub file with a text editor. copy your SSH key exactly as it is written without adding any newlines or whitespace. Now paste it into the “Key” field. Leave the title out. Click Add Key and that is all.
    • Configuring Git with GitHUB Setting Up Info Git tracks who makes each commit by checking the user’s name and email. To set these, enter the code below, replacing the name and email with your own. The name should be your actual name, not your GitHub username. More options include git config --global color.branch auto git config --global color.diff auto Find more customization options here: http://book.git-scm.com/5_customizing_git.html
    • Configuring Git with GitHUB Testing setup To make sure everything is working type the following code. You should get Type Yes and you are done!
    • Working with Git Locally Creating Projects Navigate into the directory you want to create project in and run this command $ git init
    • Working with Git Locally Adding Files to Staging Area In Git, you have to add file contents to your staging area before you can commit them $ git add . (add all files recursively) $ git add * (add all files)
    • Working with Git Locally Checking Status of project See what the status of your staging area is compared to the code in your working directory, you can run the git status command $ git status $ git status –s (non-verbose)
    • Working with Git Locally Committing Changes Run this command to actually record snapshot that has been added. Git records your name and email address with every commit you make.$ git commit -m ‘first commit‘ Every commit should be accompanied by a message which describes what the commit is about. You specify this with ‘-m’ flag.
    • Working with Git Locally Branch Command The git branch command is a general branch management tool for Git. A git branch is basically the context in which you currently work. To create a new branch run $ git branch [branchname] (creates a branch) $ git branch (lists existing branch) When you run git init, a ‘master’ branch is automatically created.
    • Working remotely with Github So far, we have been working with Git on a local system. To put your project up on GitHub, you’ll need to have a GitHub repository for it to live in. Follow the following steps. Login into Github and click on New Repository
    • Working remotely with Github Proceed to fill the form to create a new repository.
    • Working remotely with Github Each Repository has a unique URL. This would be needed when you want to move your files to github. Go to the Repository page and you would find the URL as similar as below:
    • Working remotely with Github Adding a remote repository and alias If you want to share a locally created repository to github it is generally easiest to add it as a remote on your local machine. Git stores an alias or nickname for each remote repository URL So that you dont have to use the full URL of a remote repository every time you want to synchronize with it. To add a remote use the remote add command $ git remote add [alias] [url] alias = Name you want to refer to the remote eg origin, project etc url = unique url of the remote repository. Example git remote add origin git@github.com:dadepo/Padly.git
    • Working remotely with Github Copying a Git Repository with Clone If you need to collaborate with someone on a project, or if you want to get a copy of a project so you can look at or use the code, you will clone it. To do this run the following command: $ git clone [url] url = unique url of the remote repository. For example to clone a repository at git@github.com:dadepo/Padly.git you type git clone git@github.com:dadepo/Padly.git
    • Working remotely with Github Updating from a remote repository Git has two commands to update itself from a remote repository. git fetch git pull The difference in these two commands in the simplest terms is that, "git pull" does a "git fetch" followed by a "git merge".
    • Working remotely with Github Updating a remote repository To update a remote repository with changes you have made locally you run the following command git push [alias] [branch] * If someone else has pushed since you last fetched and merged, the Git server will deny your push until you are up to date.
    • More Resources on Githttp://help.github.com/http://learn.github.com/p/intro.htmlhttp://gitref.org/index.html