mirror of
https://github.com/tiktok/sparo.git
synced 2024-11-30 10:56:54 -05:00
1 line
No EOL
15 KiB
JavaScript
1 line
No EOL
15 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[270],{7356:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>o,contentTitle:()=>n,default:()=>a,frontMatter:()=>c,metadata:()=>d,toc:()=>h});var i=s(678),r=s(4738);const c={title:"Overview"},n=void 0,d={id:"pages/commands/overview",title:"Overview",description:"The git command-line tool supports various subcommands such as git clone, git checkout, and so forth. The sparo command-line is intended to be a complete replacement for git.",source:"@site/docs/pages/commands/overview.md",sourceDirName:"pages/commands",slug:"/pages/commands/overview",permalink:"/sparo/pages/commands/overview",draft:!1,unlisted:!1,editUrl:"https://github.com/tiktok/sparo/tree/main/apps/website/docs/pages/commands/overview.md",tags:[],version:"current",frontMatter:{title:"Overview"},sidebar:"docsSidebar",previous:{title:"<profile-name>.json",permalink:"/sparo/pages/configs/profile_json"},next:{title:"sparo auto-config",permalink:"/sparo/pages/commands/sparo_auto-config"}},o={},h=[{value:"Mirrored commands",id:"mirrored-commands",level:2}];function l(e){const t={a:"a",code:"code",em:"em",h2:"h2",li:"li",ol:"ol",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["The ",(0,i.jsx)(t.code,{children:"git"})," command-line tool supports various subcommands such as ",(0,i.jsx)(t.code,{children:"git clone"}),", ",(0,i.jsx)(t.code,{children:"git checkout"}),", and so forth. The ",(0,i.jsx)(t.code,{children:"sparo"})," command-line is intended to be a complete replacement for ",(0,i.jsx)(t.code,{children:"git"}),"."]}),"\n",(0,i.jsx)(t.p,{children:"Sparo has four kinds of subcommands:"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Mirrored subcommands"})," such as ",(0,i.jsx)(t.code,{children:"sparo branch"})," and ",(0,i.jsx)(t.code,{children:"sparo revert"})," directly invoke the corresponding ",(0,i.jsx)(t.code,{children:"git"})," version of that subcommand. The motivation for using mirrored subcommands is to enable Sparo to provide advice about parameters that may cause performance issues. Additionally, you can optionally configure Sparo to collect anonymized usage metrics to help you measure the experience in your repository. (Collected data is sent to your own service. It is not accessible by any other party.)"]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Enhanced subcommands"})," follow the same basic design as their ",(0,i.jsx)(t.code,{children:"git"})," counterparts, but with adaptations for sparse checkout profiles and more efficient defaults. There are four enhanced commands:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.code,{children:"sparo checkout"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.code,{children:"sparo clone"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.code,{children:"sparo fetch"})}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"sparo pull"})," ",(0,i.jsxs)(t.em,{children:["(not implemented yet; currently mirrors ",(0,i.jsx)(t.code,{children:"git pull"}),")"]})]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Renamed subcommands"})," are the mirrored versions of the four enhanced subcommands. They are renamed to add a ",(0,i.jsx)(t.code,{children:"git-"})," prefix:"]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.code,{children:"sparo git-checkout"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.code,{children:"sparo git-clone"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.code,{children:"sparo git-fetch"})}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"sparo git-pull"})," ",(0,i.jsx)(t.em,{children:"(not implemented yet)"})]}),"\n"]}),"\n",(0,i.jsxs)(t.ol,{start:"4",children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Auxiliary subcommands"})," are new subcommands that provide Sparo-specific functionality. They are:"]}),"\n"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.code,{children:"sparo auto-config"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.code,{children:"sparo init-profile"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.code,{children:"sparo list-profiles"})}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"sparo inspect"})," ",(0,i.jsx)(t.em,{children:"(not implemented yet, will report working directory status and diagnostics)"})]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"sparo reclone"})," ",(0,i.jsx)(t.em,{children:"(not implemented yet, will efficiently revert to a clean clone)"})]}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"mirrored-commands",children:"Mirrored commands"}),"\n",(0,i.jsxs)(t.p,{children:["Each subcommand has its own page in this documentation, except for the mirrored commands which are already covered by the Git documentation. For convenience, the most essential ",(0,i.jsx)(t.a,{href:"https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain",children:'"porcelain"'})," subcommands are listed in the table below, however every Git subcommand is supported."]}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Subcommand"}),(0,i.jsx)(t.th,{children:"Summary"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-add",children:"git add"})}),(0,i.jsx)(t.td,{children:"Add file contents to the index"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-am",children:"git am"})}),(0,i.jsx)(t.td,{children:"Apply a series of patches from a mailbox"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-archive",children:"git archive"})}),(0,i.jsx)(t.td,{children:"Create an archive of files from a named tree"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-bisect",children:"git bisect"})}),(0,i.jsx)(t.td,{children:"Use binary search to find the commit that introduced a bug"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-branch",children:"git branch"})}),(0,i.jsx)(t.td,{children:"List, create, or delete branches"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-bundle",children:"git bundle"})}),(0,i.jsx)(t.td,{children:"Move objects and refs by archive"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-checkout",children:"git checkout"})}),(0,i.jsx)(t.td,{children:"Switch branches or restore working tree files"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-cherry-pick",children:"git cherry-pick"})}),(0,i.jsx)(t.td,{children:"Apply the changes introduced by some existing commits"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-citool",children:"git citool"})}),(0,i.jsx)(t.td,{children:"Graphical alternative to git-commit"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-clean",children:"git clean"})}),(0,i.jsx)(t.td,{children:"Remove untracked files from the working tree"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-clone",children:"git clone"})}),(0,i.jsx)(t.td,{children:"Clone a repository into a new directory"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-commit",children:"git commit"})}),(0,i.jsx)(t.td,{children:"Record changes to the repository"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-describe",children:"git describe"})}),(0,i.jsx)(t.td,{children:"Give an object a human readable name based on an available ref"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-diff",children:"git diff"})}),(0,i.jsx)(t.td,{children:"Show changes between commits, commit and working tree, etc"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-fetch",children:"git fetch"})}),(0,i.jsx)(t.td,{children:"Download objects and refs from another repository"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-format-patch",children:"git format-patch"})}),(0,i.jsx)(t.td,{children:"Prepare patches for e-mail submission"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-gc",children:"git gc"})}),(0,i.jsx)(t.td,{children:"Cleanup unnecessary files and optimize the local repository"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-gitk",children:"git gitk"})}),(0,i.jsx)(t.td,{children:"The Git repository browser"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-grep",children:"git grep"})}),(0,i.jsx)(t.td,{children:"Print lines matching a pattern"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-gui",children:"git gui"})}),(0,i.jsx)(t.td,{children:"A portable graphical interface to Git"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-init",children:"git init"})}),(0,i.jsx)(t.td,{children:"Create an empty Git repository or reinitialize an existing one"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-log",children:"git log"})}),(0,i.jsx)(t.td,{children:"Show commit logs"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-maintenance",children:"git maintenance"})}),(0,i.jsx)(t.td,{children:"Run tasks to optimize Git repository data"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-merge",children:"git merge"})}),(0,i.jsx)(t.td,{children:"Join two or more development histories together"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-mv",children:"git mv"})}),(0,i.jsx)(t.td,{children:"Move or rename a file, a directory, or a symlink"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-notes",children:"git notes"})}),(0,i.jsx)(t.td,{children:"Add or inspect object notes"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-pull",children:"git pull"})}),(0,i.jsx)(t.td,{children:"Fetch from and integrate with another repository or a local branch"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-push",children:"git push"})}),(0,i.jsx)(t.td,{children:"Update remote refs along with associated objects"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-range-diff",children:"git range-diff"})}),(0,i.jsx)(t.td,{children:"Compare two commit ranges (e.g. two versions of a branch)"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-rebase",children:"git rebase"})}),(0,i.jsx)(t.td,{children:"Reapply commits on top of another base tip"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-reset",children:"git reset"})}),(0,i.jsx)(t.td,{children:"Reset current HEAD to the specified state"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-restore",children:"git restore"})}),(0,i.jsx)(t.td,{children:"Restore working tree files"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-revert",children:"git revert"})}),(0,i.jsx)(t.td,{children:"Revert some existing commits"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-rm",children:"git rm"})}),(0,i.jsx)(t.td,{children:"Remove files from the working tree and from the index"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-shortlog",children:"git shortlog"})}),(0,i.jsx)(t.td,{children:"Summarize 'git log' output"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-show",children:"git show"})}),(0,i.jsx)(t.td,{children:"Show various types of objects"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-sparse-checkout",children:"git sparse-checkout"})}),(0,i.jsx)(t.td,{children:"Reduce your working tree to a subset of tracked files"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-stash",children:"git stash"})}),(0,i.jsx)(t.td,{children:"Stash the changes in a dirty working directory away"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-status",children:"git status"})}),(0,i.jsx)(t.td,{children:"Show the working tree status"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-submodule",children:"git submodule"})}),(0,i.jsx)(t.td,{children:"Initialize, update or inspect submodules"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-switch",children:"git switch"})}),(0,i.jsx)(t.td,{children:"Switch branches"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-tag",children:"git tag"})}),(0,i.jsx)(t.td,{children:"Create, list, delete or verify a tag object signed with GPG"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:(0,i.jsx)(t.a,{href:"https://git-scm.com/docs/git-worktree",children:"git worktree"})}),(0,i.jsx)(t.td,{children:"Manage multiple working trees"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:". . ."}),(0,i.jsx)(t.td,{children:(0,i.jsxs)(t.em,{children:["...and many other subcommands including any custom commands found in the shell ",(0,i.jsx)(t.code,{children:"PATH"})]})})]})]})]})]})}function a(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},4738:(e,t,s)=>{s.d(t,{R:()=>n,x:()=>d});var i=s(6166);const r={},c=i.createContext(r);function n(e){const t=i.useContext(c);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:n(e.components),i.createElement(c.Provider,{value:t},e.children)}}}]); |