snippetbashTip
git — Distributed version control system. Some subcommands such as `commit`, `add`, `branch`, `switch`, `p
Viewed 0 times
commanddistributedclicontrolsomeversiongitsystem
Problem
How to use the
git command: 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>.Solution
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 initClone a remote Git repository from the internet:
git clone {{https://example.com/repo.git}}View the status of the local repository:
git statusStage 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 pushPull any changes made to a remote:
git pullReset everything the way it was in the latest commit:
git reset --hard; git clean {{[-f|--force]}}Code Snippets
Create an empty Git repository
git initClone a remote Git repository from the internet
git clone {{https://example.com/repo.git}}View the status of the local repository
git statusStage all changes for a commit
git add {{[-A|--all]}}Commit changes to version history
git commit {{[-m|--message]}} {{message_text}}Context
tldr-pages: common/git
Revisions (0)
No revisions yet.