#!/bin/bash # Variables GCM_DEB_URL="https://github.com/git-ecosystem/git-credential-manager/releases/download/v2.6.0/gcm-linux_amd64.2.6.0.deb" GCM_DEB_FILE="gcm-linux.deb" # Step 1: Update the system and install required packages echo "Updating system and installing dependencies..." sudo apt update sudo apt install -y git curl # Step 2: Download Git Credential Manager echo "Downloading Git Credential Manager from $GCM_DEB_URL..." curl -L $GCM_DEB_URL -o $GCM_DEB_FILE # Step 3: Install the downloaded .deb package echo "Installing Git Credential Manager..." sudo dpkg -i $GCM_DEB_FILE # Step 4: Fix any broken dependencies (if necessary) echo "Fixing any broken dependencies..." sudo apt --fix-broken install -y # Step 5: Configure Git to use GCM as the credential helper echo "Configuring Git to use GCM as the credential helper..." git config --global credential.helper gcm # Step 6: Configure the credential store to use secretservice echo "Configuring the credential store to use secretservice..." git config --global credential.credentialStore secretservice # Step 7: Clean up downloaded .deb file echo "Cleaning up downloaded files..." rm -f $GCM_DEB_FILE # Step 8: Confirm setup echo "Setup completed. Verifying installation..." git-credential-manager --version # Final message echo "Git Credential Manager is successfully installed and configured!"