September 2, 2015

Creating a Github Repository for Selenium Webdriver Project

This post is regarding Creating a repository using Git and Eclipse.

GitHub:

GitHub is a Web-based Git repository hosting service, which offers all of the distributed revision control and source code management (SCM) functionality of Git as well as adding its own features. More information about GitHub: Click Here

What is need of Version Control System?Version Control/Source Control/Revision Control is a system remembers history of your files.Ex:Below are some of the reasons why we use Repository. 1. Lets assume there are 4 resources in your project and Resource 1 developed a function which is useful to other members, then he need to save that file in central location where every one can get that function.2. Made a change to code, realized it was a mistake and wanted to revert back3. Lost code or had a backup that was too old4. Wanted to see the difference between two (or more) versions of your codeAdvantages:

Made a change to code, realized it was a mistake and wanted to revert back?

Lost code or had a backup that was too old?

Had to maintain multiple versions of a product?

Wanted to see the difference between two (or more) versions of your code?

Wanted to prove that a particular change broke or fixed a piece of code?

Wanted to review the history of some code?

Wanted to submit a change to someone else's code?

Wanted to share your code, or let other people work on your code?

Wanted to see how much work is being done, and where, when and by whom?

Wanted to experiment with a new feature without interfering with working code?

Create GitHub Account:Navigate to Join GitHub and Create an account.By default Free account will be chosen. Click Finish Signup button.You will get a verification email and click Verify Email button in that email.After clicking that it will navigate you to GitHub Home Page. Where you can create repositories.Prerequisites:Eclipse Latest Version (At least Luna)Sample Webdriver Project using Maven (Create-sample-maven-project.html)GitHub AccountSteps to Create Git Repository:1. In eclipse Right click on Project Team --Share Project.2. Select Git and Click Next.3. Click on Create button and Give path of local repository (F:\Gitrepo)

5. Now if you observe project is moved to (F:\Gitrepo)6. Now lets commit our changes to local repo.. Right click on project --Team---Commit7. Enter a commit message this is a best practice and select files you want to commit. Click Commit.

8. Once you committed it will create a master under local folder.

9. Now Navigate to GitHUb and create a repository.

10. Once the repo is created copy repo URL as shown in below screenshot.

11. Now back to eclipse and Right click on remotes under Git repositories --Create Remotes

12. No Need to change name..Click OK.

13. in the next screen click Change and enter repo url and credentials.