Sitemap
Manjiri kalkundrikar

Manjiri kalkundrikar

Hi, I'm Manjiri Kalkundrikar, with extensive knowledge in the software testing field.

Git and Github

6 min readNov 13, 2024

Q. 1) What is Git?

Git is a version control system that lets you manage and keep track of your source code history.

Q. 2) What is GitHub?

GitHub is a cloud-based hosting service that lets you manage Git repositories.

Q. 3) What is the difference between Git and GitHub?

Git is the tool,

While GitHub is the service to use git.

Q. 4) What is the advantage of using GitHub for Selenium?

GitHub is a cloud-based hosting service that lets you manage Git repositories.

It helps to have a backup code in case of physical failures.

· github supports branching, so we can have multiple versions of code.

· github supports project cloning, so it helps in easily distribution of project across multiple teams and multiple locations

· github supports code pull so anyone with access rights can pull code in local machine. This can also be integrated with jenkins.

· github supports code push so anyone with access rights can checking code in github central repository.

Q.5) Different Terminologies with GitHub?

Repository: It is a storage area of your workplace that contains all your documentation files and the history of changes.

Clone: Clones are literally clones (copies) of a repository .

Commit: Whatever the changes you make in your files will come under commit.

Push: Sending the committed changes to a remote repository such as GitHub.com.

Pull Request: If you have made changes in code/script, to show the other collaborators you can send a pull request.

Branching: When you extract a portion/section of code from the main or remote track of your software, then it is called ‘branch’ and the process is known as Branching.

Merge: Merging takes the changes from one branch and applies them into another.

Q. 6) Explanation

In some companies following

The team lead is managing the github and multiple peoples are comes under team lead and they are working on different task.

so Team lead will create a new repository on github and new project just like a framwork from scratch, he will prepare the base the he will create and add the file in his git local repositry, then will commit and push the changes to the remote repository, Once done then he will inform to the entire team like i already created new project and pushed into the github repository, so plz clone that project and continued with your task

Cloning means team memeber will copy the project in their local system and then they can start the work, whatevr the task they allocated they can perform thoes task.

so team member clone remote repo to local repository,Import the project from git to workspace then they can add or modify the code, then they will have to create new branch in github and add files to staging ,commit and push the changes to the remote repository, then they will have to pull request for review code

The team lead will review the code and if the code is good then he will approve and he will inform the team member he can merge the code into the master branch, else he can merge

Suppose, he wants to change something, then they can just give a comment, again the team members will make changes then he will do all processes again like commit and push the code into the branch, so this communication keeps on going till the code is working well and lead should approve that code

Press enter or click to view image in full size

Q. 7) How to create new local repository

Either click from ‘Create a new repository’ from the git repository window

or, Once a project is done then right click on project >> Team >> Share project >> click on the checkbox of create repository in the parent folder of project >> Create repository >> finish

Q. 8) How to add the project in the local repository?

‘Add to Index’ this command will add the project to the Staging area

When you stage a file in Git, it means you instruct Git to track changes to the file in preparation for a commit.

Q. 9) How to commit the program

Right click on project >> Team >> Commit >> Add comment and then click on ‘Commit’

Q.10) How to create new repository on the GitHub

Click on ‘create new repository ‘ button or ‘+’ button from GitHub account

Q. 11) How to Push the project into the github repository

Get Manjiri kalkundrikar’s stories in your inbox

Join Medium for free to get updates from this writer.

Either, you can push it from >> right click from git repository >> Remote >> Push >> Paste the github repository URL >> Creds as a User (Email) and password >> Select specifications for Push>> + Add Spec >>Finish >>Close

or

Right click on Project >> Team >> Remote >> Push >> Paste the github repository URL >> Creds as a User (Email) and password >> Select specifications for Push>> + Add Spec >>Finish >>Close

Q.12 How ro clone the project

In eclipse >> click on the ‘Clone a git repository’ button >>Clone URL >> Give the creds of test engineer account>>Finish >> Click on ‘Refresh’ button

Right click on Pacakge explorer any blank space>> Import>> Select ‘Git’ >Select ‘ Project from Git’>> Select ‘Exisitng local repositpory’ >>Select the project >> Next>> Select radio button as ‘Import Existing Eclipse project >> Next >> click on checkboxes of project and seacrh for nested project>> Finish

Observe under the package explorer, the project is copied

Q. 13) How to create new Branch

Right click on local repository Branches>> Switch to>> New Branch>> Enter name of branch >> Finish

Q. 14) How to push the code into the Created local branch

Right click on Project >> Team >> commit

Right click on created branch name>> Push Branch>> Select Branch>> Preview >>Enter the creds of Test engineer >> Login>> Push

Q.15) How to send the pull request

Login of github repository as a test engineer account >> Select repository >> Select Branch>> New pull request>> Select the person name on request to review>> Enter message >> Click on ‘Create a pull request’

Q.16) How to revirew the shared code by someone (as a lead)

Log into the Lead account >> Select the branch from ‘master Branch ‘ dropdown>> Click on the comment

Q.17) How to ‘Merge Pull Request’

Log into the Lead account >> Select the branch from ‘master Branch ‘ dropdown>> Click on the comment >> Select ‘Create a merge commit’ from ‘Merge pull request’>> Enter comment>> Click on ‘Confirm Merge’

Q. 18) Another Simple example for Github (From automationtestinginsider)

Explain- Let’s an example there are three team members in team (QA1, QA2,QA3), they are working one project, and we have one team leader,

All the team members have git installed locally in their system. They have their own local repository

Some different task which given by team lead to all team member

QA1 is working on Registration

QA2 is working on Homepage

QA3 is working on Product

And team lead has framework access

Suppose QA2 team member need other code, suppose he need registration page code, so how will they share the code, how they will access framework

Team lead created the account ati.github.com and created the central repository now

He will push his framework to this central repository

Now all the team members can access the central repository , bcz team lead given the permission for access the central repository to all the team members.

So the team members can access the code from central repository thru Pull command.

Other team members have to work on their respective pages, once they are done with code then they will push the code to central repository

How to work with Git and Github using Eclipse (From automationtestinginsider)

Once project is done on eclipse then click on ‘Perspective’ from Eclipse then ‘Git repository’ window will open select Git and Git Repositories options

Then create new local repository.

Push the code into local repository, for Push right click on Project>>Team>>Share project>>Select repository mean location>>Finish

Create central repository on Github and login it, once logged then create new repository (Team lead share the creds and url for central repository)

Commit and Push from local repository into central repository, for that Right click on project>>team>>commit then ‘Git staging’ window will open in that write comment and click on ‘commit and push’

Copy the git project url and paste it,also enter creds for gits accounts and push the code then refresh the github page, you can see code on central repository.

Pull the code

Right click on project>>Team>>pull

See the project url and click on Close

and we can see the project from github central repository in eclipse.

--

--

Manjiri kalkundrikar
Manjiri kalkundrikar

Written by Manjiri kalkundrikar

Hi, I'm Manjiri Kalkundrikar, with extensive knowledge in the software testing field.