16/03/18

Git Handbook

Git Setup

How to setup git with SSH Key

git remote set-url origin [email protected]:<Username>/<Project>.git

Configure username and mail

git config --global user.name "Name Surname"
git config --global user.email "mymail(at)mydomain.com"

Filename too long in git for windows

git config --system core.longpaths true

Note: You need to run as administrator.
Ref: https://stackoverflow.com/questions/22575662/filename-too-long-in-git-for-windows

Windows CRLF chars.

Su windows bisogna disattivare questa funziona altrimenti non funzionano i caratteri CRLF.
git config core.autocrlf false

How can I debug git/git-shell related problems?

If you have problem with Git and you need to debug you can run this:

GIT_CURL_VERBOSE=1 GIT_TRACE=1 git pull
Ref: https://stackoverflow.com/questions/6178401/how-can-i-debug-git-git-shell-related-problems

How to get list of files between change log ?

If you need to get list of files (included directory tree) from change list you can use:

git diff-tree -r --name-only 2c636a^ 5b47402 | xargs -I {} rsync -aR {} output/

Delete files from git index when they are already deleted

git ls-files --deleted -z | xargs -0 git rm

How do I show my global git config?

git config --list

Show remote branches

git branch -vr

Git Commands

How to commit only staged modified and deleted files?

git add -u

List log with tag date


git log --date-order --graph --tags --simplify-by-decoration --pretty=format:'%ai %h %d'

Nessun commento:

Posta un commento