Skip to content

Git

Vanilla

For delete git credentials on windows we have to go into the Credential Manager. And in the Windows credentials, we have a section for generic credentials. We can edit them or just delete the entry.

Clone a repo

Bash
# With HTTP
git clone http://<host>/<repoUrl>.git
# With SSH
git clone ssh://git@<host>/<repoUrl>.git
# HTTP with plain text credentials
git clone http://<user>:<password>@<host>/<repoUrl>.git

Configs

Set username / email adress

Bash
# Set a username
git config user.name "Full Name"
git config --global user.name "Full Name"
# Set a email adress
git config user.email "[email protected]"
git config --global user.email "[email protected]"

Commands

Show changes before commit

Bash
git show

Reset merge

Bash
git reset --merge

Git-LFS

Git-LFS is an extension of git protocol create by github in the aim of improve the gestion of large non-text files. For exemple .psd, .pdf, .bin files.

Include a file extension to Git-LFS

Bash
git lfs track "*.pdf"

.gitattributes file structure

Text Only
*.pdf filter=lfs diff=lfs merge=lfs -text

Sources

Git

Git-LFS