From 33eff83839931eddbf9910fe3ecd7381e4dd9c44 Mon Sep 17 00:00:00 2001 From: Managor <42655600+Managor@users.noreply.github.com> Date: Wed, 2 Jul 2025 13:16:27 +0300 Subject: [PATCH] git: rework page (#17056) Co-authored-by: Machiavelli <145562237+MachiavelliII@users.noreply.github.com> --- pages/common/git.md | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/pages/common/git.md b/pages/common/git.md index 5e9d0379d8..6804a0ac62 100644 --- a/pages/common/git.md +++ b/pages/common/git.md @@ -1,29 +1,37 @@ # git > Distributed version control system. -> Some subcommands such as `commit`, `add`, `branch`, `checkout`, `push`, etc. have their own usage documentation. +> Some subcommands such as `commit`, `add`, `branch`, `switch`, `push`, etc. have their own usage documentation. > More information: . -- Execute a Git subcommand: +- Create an empty Git repository: -`git {{subcommand}}` +`git init` -- Execute a Git subcommand on a custom repository root path: +- Clone a remote Git repository from the internet: -`git -C {{path/to/repo}} {{subcommand}}` +`git clone {{https://example.com/repo.git}}` -- Execute a Git subcommand with a given configuration set: +- View the status of the local repository: -`git -c '{{config.key}}={{value}}' {{subcommand}}` +`git status` -- Display help: +- Stage all changes for a commit: -`git {{[-h|--help]}}` +`git add {{[-A|--all]}}` -- Display help for a specific subcommand (like `clone`, `add`, `push`, `log`, etc.): +- Commit changes to version history: -`git help {{subcommand}}` +`git commit {{[-m|--message]}} {{message_text}}` -- Display version: +- Push local commits to a remote repository: -`git {{[-v|--version]}}` +`git push` + +- Pull any changes made to a remote: + +`git pull` + +- Reset everything the way it was in the latest commit: + +`git reset --hard; git clean {{[-f|--force]}}`