1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-08 22:25:24 +02:00
tldr/pages/common/git.md
Managor 33eff83839
git: rework page (#17056)
Co-authored-by: Machiavelli <145562237+MachiavelliII@users.noreply.github.com>
2025-07-02 13:16:27 +03:00

37 lines
775 B
Markdown

# git
> Distributed version control system.
> Some subcommands such as `commit`, `add`, `branch`, `switch`, `push`, etc. have their own usage documentation.
> More information: <https://git-scm.com/docs/git>.
- Create an empty Git repository:
`git init`
- Clone a remote Git repository from the internet:
`git clone {{https://example.com/repo.git}}`
- View the status of the local repository:
`git status`
- Stage all changes for a commit:
`git add {{[-A|--all]}}`
- Commit changes to version history:
`git commit {{[-m|--message]}} {{message_text}}`
- Push local commits to a remote repository:
`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]}}`