6
Introduction to Git

Introduction to git

Embed Size (px)

Citation preview

Introduction to Git

Introduction to Git

Introduction to Git.1

What is version control system?This is a very important tool in developers daily life.It behaves like a time machine.You can commit your code in version control system. You can also check history from version control system about what are the changes are made in past in your codebase.You can compare changes made to a particular file.It works best with text based files.The most popular areSVN,TFS, andGit

A basic introduction of version control system. A developer can use version control system for daily common tasks with codebase.2

Types of version control systemIn respect to developer work flow:Checkout edit checkin processEdit merge commit

In respect to connection with version control system server:Connected version control systemDisconnected version control system

In respect to developer work flow, there are two types of version control systems:

Checkout edit checkin process: You need to first checkout a file and work with that. While you are making changes in that file, others cannot change that file content. In that time you have a write lock on that file. After you have done with your changes you can checkin the file and release the lock. Then other developer can take update and checkout the file in same manner.

Edit merge commit: No need to checkout the file first. You can start working and making changes in the file. When you are done with your changes and ready to commit, you need to take update and merge other programmer changes in your file and commit the change in the version control system. More than one programmer can work in same file in this process. Because in this process no one take write lock in the file and can make changes in same file at the same time, you need to merge the other developers changes before commit.

In respect to connection with version control system server, there are two types:

Connected version control system: All history information are placed in server. You have a working copy in your computer. You need to connect to server at the time of taking update, commit, checking history, creating branch.

Disconnected version control system: You have working copy with full history information in your computer. You have the full repository in your computer. You can commit, check history, create branch while you are not connected with the server. Finally you can connect with server and pull changes from other developer from server, merge your changes and push your changes to server. Because you have the full repository in your local computer, commit, check history, branching process become very fast. All the developers has one full repository in their computer. It is like a backup copy of repository in all developers local computer.3

GitGit works like a distributed version control system.

Install Git in Windows:msysgit (https://github.com/msysgit/msysgit)

Use Git in Windows:GitHub for Windows (https://windows.github.com/)posh-git(https://github.com/dahlbyk/posh-git)

Git for .NET programmers:Git from Visual Studio (http://bit.ly/1dmluSm)

Git works like a distributed version control system. There are many Git implementations. If you are working in Windows, you need msysgit which is the Git implementation for Windows. Also you need to install one command line tool to work with Git from command line. For Windows you can install posh-git which is a Git in Powershell.

Also you can install a GUI tool for Git like GitHub for Windows. If you are working with Visual Studio you can work with Git from Visual Studio. Visual Studio also have GUI tool for Git. While you are working in Git GUI tool if you cannot find some task in that GUI, you can use command line tool right there to complete that task. GitHub for Windows and Visual Studio both support this.4

Git hostingYou can use any Git hosted server.

Some examples are:GitHub (https://github.com/)CodePlex (https://www.codeplex.com/)Visual Studio Online (http://bit.ly/1byDtVt)

You can use any Git hosted server like GitHub, CodePlex, Visual Studio Online etc. The most popular Git hosting is GitHub. Also Visual Studio online support Git and TSF both.5

Thank youArnab Roy ChowdhurySoftware Engineer

Email: [email protected] Blog: http://wp.me/1mZ2VTwitter: @DeveloperArnab

Thanks you. You can reach me through email. If you like this presentation, please follow me through my blog and twitter.6