1 / 13

An Introduction

Learn the basics of Git, a version control system that allows you to track changes in your source code projects. Discover how to set up Git, configure it, and use essential commands for branching, merging, and collaborating with others.

emilyt
Download Presentation

An Introduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. An Introduction By Sonali and Rasika

  2. Purpose of introducing GIT • Required for the project • Show the versions of your code in the course of development • Show versions of your documentation.

  3. What is GIT? • Tool for keeping a history on state of your source code projects • Version control System • Allows Collaborative Source Code Management

  4. How To set up Git • Download Git at - http://git-scm.com/downloads • Sign-up with bit-bucket at https://bitbucket.org/ and create a 5 member free team. Invite other team members. • [optional] Install Git-hub GUI client for local machine: • windows - https://windows.github.com/ • Mac - https://mac.github.com/

  5. Configuring Git • Download and install the latest version of GitHub for Windows or Mac. This will automatically install Gitand keep it up-to-date for you. • open the Git Shell application and type: • gitconfig --global user.name "YOUR NAME" • gitconfig --global user.email "YOUR EMAIL ADDRESS"

  6. GIT Basic Commands 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

  7. Git Branching & Merging git branch //Shows all branches of current repository

  8. Git creating branches Git branch branch_name

  9. Commit in Branch git checkout branch_name //Goes to the branch git add . git commit -am “Message”

  10. Merging 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

  11. Git Fetch git fetch upstream Fetches all the changes made to the original repo from whom you have forked Git pull git pull Directly pulls the update from the original repo toyour current working repo Git clone git clone new_repo_urlyour_name Creates a repo by your_name

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

  13. Resources • Git commands - http://git-scm.com/book/commands • Git FAQs - https://help.github.com/ • Git Tutorial videos - http://git-scm.com/videos • 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/

More Related