git
ssh-agent
ssh-agent is a program to hold private keys used for public key authentication.
eval `ssh-agent` # Starts the agent, returns the pid
ssh-add
ssh-add – adds private key identities to the authentication agent (above).
ssh-add <path to key> # adds the key to the agent
sudo chmod 600 <path to key> # for WARNING: UNPROTECTED PRIVATE KEY FILE!
ssh-add -l # lists loaded keys
remove a submodule
To remove a submodule you need to:
- Delete the relevant section from the .gitmodules file.
- Stage the .gitmodules changes git add .gitmodules
- Delete the relevant section from .git/config.
- Run git rm –cached path_to_submodule (no trailing slash).
- Run rm -rf .git/modules/path_to_submodule (no trailing slash).
- Commit git commit -m “Removed submodule "
- Delete the now untracked submodule files rm -rf path_to_submodule
Initialize a local git repo
git init . # If you are in the folder
git init project_name # If you have not created the folder yet.
Settings (System, Global and Local)
System level
applied to every user on the system and all their repositories
git config --list --system # to view (may need sudo)
git config --system color.ui true # to set,
git config --edit --system # to edit system config file,
Global level
values specific personally to you, the user.
git config –list –global # to view git config –global user.name xyz # to set git config –edit –global # to edit global config file
Repository level
specific to that single repository
git config –list –local # to view, git config –local core.ignorecase true # to set, (–local optional) git config –edit –local (–local optional) # to edit repository config file,
How to view all settings?
git config –list # showing system, global, and (if inside a repository) local configs git config –list –show-origin # also shows the origin file of each config item
How to read one particular config?
git config user.name # to get user.name, for example.
You may also specify options –system, –global, –local to read that value at a particular level.