- Verify Git is installed.
- Initialize a repository and inspect its status.
- Stage and commit files.
- Restore deleted files from history.
- Configure author identity for commits.
- Git installed on your machine. Many Ubuntu distributions include Git by default.
- If you’re unsure, verify with:
- Change into your project directory (for example, the
Blockbusterfolder). - Before initialization you should not see a
.gitdirectory:
- Initialize the repository:
- Confirm the
.gitdirectory exists:
README.md (for example, fix a typo), then stage and commit the change:
user.name and user.email. You can set these globally (applies to all repositories for your user) or locally (only for the current repository).
Set a global identity:
If you are working on a shared machine or with multiple identities, prefer using
git config --local (inside the repo) to avoid changing your global settings. You can always override per-repository with the local config.
Links and references
- Official Git: https://git-scm.com
- Git documentation: https://git-scm.com/doc
- Git config documentation: https://git-scm.com/docs/git-config