Install and configure Git
Install Git from the distribution packages, set your identity and sensible defaults, and reach remote repositories over SSH with a key.
Clone, commit, push and pull
The everyday Git loop on a server: clone a repository, stage and commit changes, push them to the remote and pull what others wrote.
Create, switch, merge and delete branches
Work on features in separate branches: create and switch with git switch, merge them back, track remote branches and tidy up old ones.
Rebase and cherry-pick
Replay a branch on top of main with git rebase, clean up commits with interactive rebase, and copy single fixes between branches with cherry-pick.
Undo with reset, revert and stash
Throw away edits with restore, move a branch back with reset, cancel pushed commits with revert, park work with stash and rescue anything with the reflog.
Git submodules
Embed one repository inside another at a fixed commit: add, clone recursively, update to newer commits, change the URL and remove a submodule cleanly.
Deploy with a bare repository and hooks
Push to a bare repository on your VPS and let a post-receive hook check out the code, build it into a release folder and restart the service.
Other topics
- Your server and account
- Server basics
- Security
- Networking and diagnostics
- Web servers and proxies
- PHP and web stacks
- Node.js
- Python
- Go, Ruby, Java and other runtimes
- Databases
- Containers and PaaS
- Websites, CMS and shops
- Self-hosted apps
- VPN and private DNS
- Monitoring and logs
- Email servers
- Game and voice servers
- Control panels
- File transfer and archives
- Linux command line
- Bash scripting
- Developer tools and CI
- Media and streaming
- Queues and messaging