1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-15 20:15:28 +02:00

git: rework page (#17056)

Co-authored-by: Machiavelli <145562237+MachiavelliII@users.noreply.github.com>
This commit is contained in:
Managor 2025-07-02 13:16:27 +03:00 committed by GitHub
parent a4aea40364
commit 33eff83839
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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: <https://git-scm.com/docs/git>.
- 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]}}`