GIT Integration
Last updated
Was this helpful?
Last updated
Was this helpful?
Git is the world's most popular version control system. Version control allows you to maintain a history of changes to text files (such as a codebase) over time, tracking what changes were made, by whom, at what time, and for what purpose. Projects in Git are organized into repositories: a collection of files and changes to those files over time. Git is a distributed version control system, meaning that the main repository can be cloned (for example to a developer's laptop) and changes from multiple developers can be merged and pushed to a shared central repository.
A Git host is a service provider who hosts Git repositories. Git hosts may be on the cloud or in corporate on-premise infrastructure. A Git host provides a central place for teams to synchronize their changes, provides a central backup of the Git repository, and provides other services such as APIs, a user interface, and the ability to create merge requests (aka pull requests). There are many Git hosts. The most popular ones are:
GitHub
BitBucket
GitLab
Azure Repos
AWS CodeCommit (not accepting new customers)
Before registering Git with ARM, there are some prerequisites.
Ensure you enable the Git
plugin under Plugins
in the My Account
section to use Git for version control.
You must have permission in ARM to register a repository.
You must have credentials for the repository you want to access.
You must store these Git credentials in ARM.
This is an initial step in storing your user's credentials (usually a username, password, or token) in ARM. Some Git hosts like GitHub no longer support basic authentication using a username and password. You must now authenticate using an API token, such as an OAuth access token, GitHub App installation access token, or personal access token.
Log in to your ARM account.
Hover your mouse over the Admin
module and click on the Credentials
tab.
Next, click on Create Credential
from the right navigation bar.
On the next pop-up screen, give a Credential name
.
Choose the Credential Type
as Username With Password.
Enter your Username
for the Git host and API Token (in the Password
field), and we will store this encrypted. For more information on how to create an API token, see the Troubleshooting section on this page.
Click Save
.
To set up a Git repository, follow the steps below:
Log in to your ARM account.
Hover your mouse over the Admin
module and click on VC Repo's
.
Click on Register Repository
.
Select the Version Control System
as Git
on the Register Repository
page.
Enter the name of the repository to display it locally.
Paste the Repository URL
from your Git host.
Choose the correct user's Credentials
from the list. To create new credentials, click on the **+
**icon.
The Default Branch
selection will be in disabled mode by default. Click the icon to fetch and list all the available branches on your remote repository.
Select one of the default branches from the list. Note:Ensure the default branch is available in your remote repository with some files committed to it. If no file is available, create a README.txt file and add it to the repository.
Once the registration is done, you can find the newly added repository on VC Repo's
home page.
The Sync Branches radio button allows you to view branches that are no longer available in your version control repositories but are still visible in the ARM application, and you can delete them from the ARM application as well.
While registering Git with ARM, Git fails to connect, resulting in Authenticate Failure. This is because your credentials are invalid. Check the URL, username, and API token (or other authentication mechanism).