English
Summary
Conclusions
Git is a distributed version control system: every copy of a repository contains the entire history, and most operations run locally. Changes travel from the working directory through the index to the repository, where they are stored as commits—snapshots of the project with an author and a message. The .gitignore and .gitattributes files determine which files to store and how to normalize line endings. Branches isolate feature development; they are combined by merging or rebasing, and conflicts are resolved manually. Uncommitted changes are undone with git restore, published commits with git revert, and history may be rewritten (reset, amend, rebase) only before it is published. Tags mark versions, log -S, blame, and bisect help you search for changes, and hooks automate checks. Collaboration relies on remote repositories: a bare repository on disk or GitHub hosting with pull requests. All of these operations are available both in the terminal and in the Visual Studio 2026 windows.
Self-check questions
- How does a distributed version control system differ from a centralized one?
- Which Git settings must you configure before your first commit, and why?
- What are the working directory, the index, and the repository? Which commands move changes between them?
- What is a commit and a commit hash? What does
HEAD~1mean? - How does
git diffdiffer fromgit diff --staged? - Which .NET project files are not added to the repository? How do you remove an already committed
binfolder? - How does
git revertdiffer fromgit reset? When must you not usereset? - What do
git restore,git restore --staged,git commit --amend, andgit stashdo? - What is a branch? How does a fast-forward merge differ from a three-way merge?
- How does rebasing differ from merging? When is
git cherry-pickused? - How does a merge conflict arise, and how do you resolve it in the terminal and in Visual Studio?
- How do you find the commit that introduced a bug using
git bisect? - What is a Git hook? How do you make hooks shared by all team members?
- What is a bare repository? How does
git fetchdiffer fromgit pull? - Why does the server reject
git push, and how do you fix it?
Useful links
- Git for Windows: https://git-scm.com/install/windows
- The "Pro Git" book in Ukrainian: https://git-scm.com/book/uk/v2
- Git command reference: https://git-scm.com/docs
- Git hooks: https://git-scm.com/docs/githooks
- File attributes: https://git-scm.com/docs/gitattributes
- .NET templates, including
gitignoreandgitattributes: https://learn.microsoft.com/dotnet/core/tools/dotnet-new-sdk-templates - Git in Visual Studio: https://learn.microsoft.com/visualstudio/version-control/
- Resolving conflicts in Visual Studio: https://learn.microsoft.com/visualstudio/version-control/git-resolve-conflicts
- Working with Git on GitHub: https://docs.github.com/en/get-started/using-git
- GitHub Flow: https://docs.github.com/en/get-started/using-github/github-flow
- Pull requests: https://docs.github.com/en/pull-requests
- Git Credential Manager: https://github.com/git-ecosystem/git-credential-manager