Transcript Git-Hub

An Introduction

By Sonali and Rasika

   Required for the project Show the versions of your code in the course of development Show versions of your documentation.

   Tool for keeping a history on state of your source code projects Version control System Allows Collaborative Source Code Management

1.

2.

3.

Download Git at http://git scm.com/downloads Sign-up with bit-bucket at https://bitbucket.org/ members.

and create a 5 member free team. Invite other team 1.

[optional] Install Git-hub GUI client for local machine: windows https://windows.github.com/ 2.

Mac https://mac.github.com/

1.

2.

3.

4.

Download and install the latest version of GitHub for Windows or Mac . This will automatically install Git date for you.

and keep it up-to open the Git Shell application and type: git config --global user.name " YOUR NAME " git config --global user.email " YOUR EMAIL ADDRESS "

git init //initializes git git add filename //adds file name git diff //prints difference made in files git commit -m “Message here ” //saved!!

git status //prints status of current repository git log //history git push [options] origin branch_name //updates a remote repository with the changes made locally

git branch //Shows all branches of current repository

Git branch branch_name

git checkout branch_name git add .

git commit -am “Message” //Goes to the branch

git merge master branch_name //Used to merge your work with master git checkout -b branch_name //Creates new branch and goes to that branch git branch -d branch name //Deletes the given branch

git fetch upstream Fetches all the changes made to the original repo from whom you have forked git pull Directly pulls the update from the original repo to your current working repo git clone new_repo_url your_name Creates a repo by your_name

How to go Back to the last commit?

git checkout checksum_number git reset --hard checksum_number You will have same status as that commit's data !!

Concept: It goes to a no branch state, one can make edits and also commit. But then you need to create that into new branch More information at: http://stackoverflow.com/questions/4114095/revert-to-a-previous-git-commit

       Git commands http://git scm.com/book/commands Git FAQs https://help.github.com/ Git Tutorial videos scm.com/videos http://git Pro Git, a book http://git-scm.com/book Learn Git in 15 mins https://try.github.io/levels/1/challenges/1 Information on git pull, push and fetch – http://gitref.org/remotes/