How to use Git with Git Hub

Steps to take:

  • Create account in Git Hub.
  • Note down user name, email and password.
  • Down load git from git-scm web site and install it. From here:
  • Open Git Bash in the folder where you wish to download. This could be your eclipse work space folder.
  • Run below commands one after another (type first line and press enter ) and replace the user name and email with your details.

    git config –global “akashdktyagi”

    git config –global “

    git config –global http.sslVerify false

    git config –global –list   ==> This will display your details

  • Go to the URL:
  • Create your branch by your name. (This will only work once I add you to the repository, for this you need to send me your GitHub user name. I will add it.)
  • Once above config is done, type command: git clone <git path of the repo>
  • “git clone”
  • Above command will clone the repo in the folder.
  • Then type command “cd CucumberWithSelenium”. This will switch folder.
  • Then run command, “git checkout Akshay” . Replace “Akshay” with your name. Remember its case sensitive.
  • Once this happens, open your eclipse.
  • Go to File->Import->Existing Maven Project->Navigate to the folder where you have cloned and select CucumberWithSelenium folder->(Pom.xml should be displayed”-> Click on Finish.
  • This will import selenium with cucumber project in your eclipse.
  • Name of the project should display your branch name.
  • Make changes and write code. Once you have done with changes, go to the folder CucumberWithSelenium again and open git bash there.
  • Type command: git status ==> This will tell you all the changes which you have made.
  • Type Command: git add .  ==> This will add all the files
  • Type Command: git commit -m”my changes” ==> this will commit your changes with the message.
  • Type Command: git push ==> this will push your changes on the server. You might have to enter password after this step.
  • Once pushed go to the URL and check if your changes are pushed.
  • For more on Git, read this:

For More Information watch these videos, I recorded earlier. First video is Basic and second one is about Git conflict resolution and Pull Requests, reviews etc.