As coding is a staple for any IoT applications, I decided to write another short article on Git for beginners. This is the continuation of Git for beginners : setting up your first project and Git for beginners : Git basics you need to know.
Are you ever annoyed when you have to enter your git password every time you fetch, push or pull from remote git repository? There is a simple solution.
For Linux ( Ubuntu distro )
If you are using git in Linux, reusing credentials was done with gnome-keyring before and now it is replaced with libsecret. Both options are described below. After you set this up, you just have to enter your git credentials one time and you are good to do any git actions without typing password every time.
For git version >= 2.11 ( new )
$ sudo apt-get install libsecret-1-0 libsecret-1-dev $ cd /usr/share/doc/git/contrib/credential/libsecret $ sudo make $ git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
For git version < 2.11 ( old )
$ sudo apt-get install libgnome-keyring-dev $ cd /usr/share/doc/git/contrib/credential/gnome-keyring $ sudo make $ git config --global credential.helper /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring
TIP: Better upgrade the git version
For Windows ( Also WSL/ WSL2)
If you are using Windows, or using Git installed in windows and using the same for WSL (Windows Subsystem for Linux), you can use the git credential helper in windows. Enter this command in your WSL distro terminal.
git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-wincred.exe"
If you are just using windows ( not WSL), then open cmd prompt and do the following
git config --global credential.helper manager
For all the above stuff to work, git has to be installed. Visit other Git for Beginner articles to learn how to do install git.