Enable Dark Mode!
how-to-add-git-credentials-in-jenkins.jpg
By: Anagha NK

How To Add Git Credentials In Jenkins

Technical

Git is one of the famous distributed version control systems. There are mainly two types of version control systems. That is Distributed & Centralised Version Control System. 

Nowadays Distributed Version Control Systems are commonly used Because Centralized Version Control Systems are older & very hectic to use. Git helps to modify any application with the help of other peers as well. So that Git is being used on a large scale in companies. Git is a repository as well as it can be installed in any third-party software. Jenkins is one of the important open-source software. In the software field, when developing software for a client,it helps in the test. Let’s check how we can add Git credentials in Jenkins

Create New Jenkins Job

Select a new item and create a new job there.

How To Add Git Credentials In Jenkins-cybrosys

Specify the URL of the repository which we need to connect with jenkins.

How To Add Git Credentials In Jenkins-cybrosys

Here add the URL of your remote repository. The following are some possible syntaxes for the repository URL:

* ssh://git@github.com/github/git.git

* git@github.com:github/git.git

* ssh://user@other.host.com/~/repos/R.git

* https://github.com/github/git.git

* git://github.com/github/git.git

Setup the build trigger

How To Add Git Credentials In Jenkins-cybrosys

Then we can mention which operation should perform after our commit in the corresponding repository/branch

How To Add Git Credentials In Jenkins-cybrosys

In some cases for example if you select pipeline to copy the HTTPS in name and change the definition pipeline from pipeline script to pipeline script from SCM. SCM was selected as Git.

How To Add Git Credentials In Jenkins-cybrosys

Enter the GitHub repository here. After that there may be an error occurs on the screen.

How To Add Git Credentials In Jenkins-cybrosys

In this case, we need to create an authentication with the GitHub repository, that is we need to set up a personal access token.

For this case go to github->settings ->Developer Settings ->Personal access tokens ->Create new token

How To Add Git Credentials In Jenkins-cybrosys

Note means the name. Give a suitable name accordingly. After that set the expiration date and generate a token. Copy the token and go back to Jenkins.

How To Add Git Credentials In Jenkins-cybrosys

How To Add Git Credentials In Jenkins-cybrosys

Copy the token in the password column, add the name in the ID column and add. So the created credentials appear there. Select the created credential.

How To Add Git Credentials In Jenkins-cybrosys

Specify the repository and save it.

Go to  Build now ->  Console output

Here view all modifications of GitHub. If go to build history see all history blocks.

How To Add Git Credentials In Jenkins-cybrosys

The Console Output gives the output from execution. It contains a complete text log of output including status, In the earlier graphical Console Output log, is illustrated, But Jenkins features a plain text option. So it can be helped to find out special characters which are included in the output. If you view it as a plain text output, just click on the View as a plain text link.


If you need any assistance in odoo, we are online, please chat with us.



0
Comments



Leave a comment

 


whatsapp
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message