minte9
LearnRemember



Remote origin

Every time you connect to a github repo you need to provide username and password. Is not secure to set credentials in remote url. Git show remote origin will display password in plain text!
 
git remote set-url origin 
     https://<USERNAME>:<PASSWORD>@github.com/myusername/testgit.git

git remote -v
    https://<USERNAME>:<PASSWORD>@github.com/myusername/testgit.git

Password

Do not store password. You can also leave your password out of the URL. Git will ask for your password, but not your username.
 
git remote set-url origin 
     https://<USERNAME>@github.com/myusername/testgit.git

Cache

Set git to use the credential memory cache. By default, Git will cache your password for 15 minutes.
 
git config --global credential.helper cache
git config --global credential.helper 'cache --timeout=3600'

Config

Change cofing entry
 
git config --list

git config --global user.name "John Doe"
git config --global user.email johndoe@example.com

# reset cache
git config --global credential.helper 'cache --timeout=3600'
Configuration remove global configurations
 
sudo gedit ~/.gitconfig
 
[credential]
    helper = cache --timeout=3600
    useHttpPath = true



  Last update: 297 days ago