GIT
Initialize Repository
Setting name and email globally
git config --global user.name "Your Name"
git config --global user.email [email protected]After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-authorCheck status, add files and Commit
git add .
git commit -m "<comment>"
git status
git remote -vAdd Remote Repository
If remote branch is main
Update Remote Repository/Change from HTTPS to SSH and vice versa
Git Credential
Remove Outdated branch (deleted remotely) from local database
Remove settings
Git Log and Git show and other commands to view files at specific commit
Configure Proxy for Git
Remove files from previous commit which was commited
Use git show to find which commit has that file
After finding which commit has file.txt, reset to 1 commit before that so that it doens't have that file:
Add all current file to git and commit, then push to github as usual
Undo changes
Undo a commit with git checkout
Undo a commit with git revert
Undo a commit with git reset
Undo a commit with git clean
Using 2 Git accounts
SSH Configuration
When pushing repository to github, may need to remove cached ssh-key so git can use the right key for authentication
Checking Log and Diff
Git Stash
Advanced Stashing
Reference
Last updated