Git Tip
Git log
Detailed log
git logHash + subject line
git log --onelineGroup commit subject by username.
git shortlogGit config
Show git config
git config -lOnly local repository
git config --local -lSet user name and email for local
git config --local user.name "Your Name Here"git config --local user.email "your@email.com"Set user name and email to global ~/.gitconfig:
git config --global user.name "Your Name Here"git config --global user.email "your@email.com"Set remote url
git remote set-url origin git@github.com:username/repo-name.gitGit branches
If mater branch was renamed on GitHub
git branch -m master maingit fetch origingit branch -u origin/main maingit remote set-head origin -aCommit Message Format
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>Commit Message Type
Must be one of the following:
- build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
- ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
- docs: Documentation only changes
- feature: A new feature
- fix: A bug fix
- perf: A code change that improves performance
- refactor: A code change that neither fixes a bug nor adds a feature
- revert: This reverts commit
<hash> - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- test: Adding missing tests or correcting existing tests