What is Git?
Git is a version control system is an open source that allows developers to track and manage changes to their code. It is a distributed version control system, which means that each developer has a local copy of the code, and changes are propagated to other developers through commits and pushes.
git config is a command-line utility that is used to set configuration values for your Git installation. These values are stored in configuration files that are located in your Git installation and in the repository where you are working.
To set the Git username and password in Git Bash, Open the Git Bash tool from the windows machine and follow the steps below,
the above command will do will store your Git username and password in plaintext in your Git configuration file.
Git credential helper:
If you want to store your Git credentials more securely, you can use the Git credential helper, you can use the following command:
This will store your Git credentials in memory for a certain amount of time (15 minutes by default). You can change the duration that the credentials are stored by setting a different cache timeout. For example, to set the timeout to 1 hour (3600 seconds), you can use the following command:
You can also use the store credential helper to store your Git credentials permanently on your computer. Execute the command below,
Note: This is not recommended, as it is less secure than using the cache or a more secure credential storage solution like a password manager.