Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Branch conventions Link to heading
- main - The main development branch
- feature - For new features
- e.g. feature/add-login-feature
- bugfix: For bug fixes
- e.g. bugfix/fix-login-bug
- hotfix: For urgent fixes
- e.g. hotfix/security-patch
- release: For specific release
- e.g. release/v1.2.0
Cheat sheet Link to heading
| COMMAND | DESCRIPTION |
|---|---|
| git status | Displays working directory status |
| git rebase -i HEAD~N (number of commits) | Squash commits |
| git push -f origin branch-name | Force push to remote repository |
| git clean -fdx | Remove all local untracked files |
| git ls-files | xargs wc -l | Count the number of lines |
| git submodule status | Displays submodule status |
| git submodule update –remote | Update submodule |
| git add | Stage submodule changes |