- What is
Git - Repository
- Remote
- Root directory of the repository
- Commit
- Branch
- Revision
- How
Gitworks - text - How
Gitworks - videos - Merge conflict
- Practice
Git .gitignoreGitHub flow- Check your
Gitconfig - Configure
Git
Git is a distributed version control system that tracks changes in your files and lets multiple people collaborate on the same codebase. It records a history of every change, so you can revert mistakes, compare versions, and work on features in parallel using branches.
Docs:
A repository (or "repo") is a storage location for files that are version-controlled using Git.
Example: GitHub repository
A remote (remote repository) is a version of your repository hosted on a remote host, e.g. GitHub.
Remotes let you push and pull changes between your local repository and the remote host.
You can inspect remotes in VS Code.
Docs:
A remote name (without < and >).
Common remote names:
A commit is a snapshot of your project at a specific point in time. Each commit records what changed since the previous commit, who made the change, and a commit message describing why. Commits form a history that you can browse, revert, or branch from.
A hash of a commit in Git.
Example: 4aeacb54f898125560c545e5e0477762094027a7
Docs:
A commit hash (without < and >).
A commit message is a short description attached to each commit. It explains what was changed and why. Good commit messages make the project history readable and help teammates understand changes without reading the code.
Guidelines:
- Keep the first line short (under 72 characters).
- Use the imperative mood ("add feature", not "added feature").
- Focus on why the change was made, not just what changed.
- (Optional) follow the
Conventional Commitsspecification.
Rules for creating human- and machine-readable commit history.
Docs:
feat:for new functionality.fix:for bug fixes.docs:for documentation changes.refactor:for code changes without behavior changes.
A branch is an independent line of development. It lets you work on a feature or fix in isolation without affecting the main branch. Under the hood, a branch is a movable pointer to a commit — as you add new commits, the pointer advances.
Branches are central to the GitHub flow: you create a branch, commit changes to it, open a pull request, and merge it back into main when ready.
Docs:
main is typically the default branch of a repository.
It represents the stable, up-to-date state of the project.
A Git branch name (without < and >).
Examples:
maindevupstream/dev
Typically a commit hash or the branch name.
Docs:
- Read this tutorial to learn about
Git,Github, and otherGitworkflows.
Quick mental model:
Working tree: your local files.Staging area: selected changes for the next commit (git add).Commit: a save point of your progress since the previous save point (git commit).Commit history: a timeline of these save points.
Simple view:
working tree changes -> git add -> git commit
(stage) (save progress)
Useful commands:
git status
git add <file-path>
git commit -m "docs: update wiki"
git log --oneline --decorate --graph -n 15
See <file-path>.
When confused, start with git status and read it carefully before running the next command.
- Watch videos to build your mental model of how
Gitworks:
A merge conflict occurs when two branches modify the same lines in a file and Git cannot automatically decide which version to keep.
Conflicts happen during git merge or git pull.
Git marks conflicting sections with conflict markers:
<<<<<<< HEAD
Your changes on the current branch.
=======
Changes from the other branch.
>>>>>>> other-branch
To resolve a conflict: choose which version to keep (or combine them), then remove all conflict markers, and commit the result.
- Practice on Learn Git Branching (focus on merge/rebase and conflicts).
The .gitignore file allows you to specify which files shouldn't be added to the repo.
Examples:
Common ignored files:
- Secrets (
.envfiles, keys, tokens). - Build artifacts (
dist/,build/). - Local caches and temporary files.
- Read about the
GitHub flow.
Typical sequence:
- Create an issue.
- Create a branch from
main. - Commit changes to the branch.
- Push branch.
- Open a PR.
- Get review.
- Merge the branch to
main.
-
To find out which name and email are used in commits,
git config --global --listThe output should look like this (but with your values):
user.name=Inno SE Toolkit user.email=inno-se-toolkit@gmail.com
Note
See docs about user.name and user.email.
Complete the following steps:
-
To set the name that will be used in commits,
git config --global user.name '<your-name>'Example:
git config --global user.name 'Inno SE Toolkit'
-
To set the email that will be used in commits,
git config --global user.email '<your-email>'Example:
git config --global user.email 'inno-se-toolkit@gmail.com'