Skip to content
Vitaliy Zhiltsov edited this page Aug 3, 2022 · 5 revisions

Auto update

sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update
sudo apt-get install git -y

If your system doesn't have add-apt-repository, you can install it via: sudo apt-get install python-software-properties software-properties-common

Authentication with Wincred

If you use Https to communicate with your git repository, Es, Github or VisualStudioOnline, you usually setup credential manager to avoid entering credential for each command that contact the server. With latest versions of git you can configure wincred with this simple command.

git config --global credential.helper wincred

If you use wincred for credential.helper, git is storing your credentials in standard windows Credential Manager

http://www.codewrecks.com/blog/index.php/2015/06/23/git-for-windows-getting-invalid-username-or-password-with-wincred/

How do I revert all local changes in Git managed project to previous state?

git checkout .

https://stackoverflow.com/questions/1146973/how-do-i-revert-all-local-changes-in-git-managed-project-to-previous-state

Git: See more context in a diff

https://makandracards.com/makandra/42698-git-see-more-context-in-a-diff Using the -U parameter you can change how many lines are shown above and below a changed section. E.g. git diff -U10 will show 10 lines above and below.