Showing posts with label git secrets. Show all posts
Showing posts with label git secrets. Show all posts

Thursday, 9 June 2022

How to install Git Secret on Windows

 Prerequisite:

Git must be configured in windows OS.

Clone awslabs/git-secrets repo using git-bash

Follow the below document to configure git-secrets globally…

  1. Update your git using git-bash. Execute the following command on git-bash.
git update-git-for-windows

2. Clone the repo

Command:

git clone https://github.com/awslabs/git-secrets.git

2. open PowerShell “run as administrator”

go to the repository where we clone the above repo. In my case path is

C:\users\dell\desktop\ttn\git-secrets

3. Check the version of the git.

git --version

4. Now execute the installation script of the windows. It simplifies the setup on windows.

./install.ps1

This might show an error like :

./install.ps1 : File C:\Users\Dell\desktop\ttn\git-secrets\install.ps1 cannot be loaded because running scripts is disabled on this system.

This is because the current PowerShell policy is restricted we can unrestricted it using the following command.

Set-ExecutionPolicy RemoteSigned

Below is the list of four different execution policies in PowerShell

  • Restricted — No scripts can be run.
  • AllSigned — Only scripts signed by a trusted publisher can be run.
  • RemoteSigned — Downloaded scripts must be signed by a trusted publisher.
  • Unrestricted — All Windows PowerShell scripts can be run.

5. Download the git-secrets.

git secrets --install

6. To add hooks to all the local repositories.

git secrets --install ~/.git-templates/git-secrets
git config --global init.templateDir ~/.git-templates/git-secrets

7. To add hooks to all repositories if we initialize or clone in the future.

git secrets --register-aws --global

How to upgrade Maven

  java.lang.IllegalStateException I had installed maven in my ubuntu using command  apt install maven This installed maven in path /usr/shar...