version=pmwiki-2.2.130 ordered=1 urlencoded=1 agent=w3m/0.5.3+git20210102 author=jrmu charset=UTF-8 csum= ctime=1636298220 host=198.251.82.194 name=Got.Usage rev=76 targets=Ksh.Profile,Openbsd.Ed,Ksh.Editor,OpenSSH.Connect,Git.Usage text=(:title Game of Trees:)%0a%0a[[http://gameoftrees.org|Game of Trees (Got)]] is a simple, easy to use%0aversion control system that aims to be compatible%0awith git repos.%0a%0aIt's still under development, but can be used today%0aas a substitute for git. It is freely reusable under%0aa BSD license.%0a%0a!! Install%0a%0a[@%0a$ doas pkg_add got%0a@]%0a%0a!! Configuring got%0a%0aFirst, we need to tell [[http://gameoftrees.org/got.1.html|got]] about the author of the repo:%0a%0a[@%0a$ export GOT_AUTHOR="username %3cusername@example.com>"%0a@]%0a%0aReplace @@username@@ and @@username@example.com@@. It's recommended to add this as part of your [[ksh/profile|~/.profile]]:%0a%0a[@%0a$ echo 'export GOT_AUTHOR="username %3cusername@example.com>"' >> ~/.profile%0a@]%0a%0aLet's also enable tab-completion of got commands:%0a%0a[@%0a$ echo 'set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)' >> ~/.profile%0a@]%0a%0aBy default, got uses the text editor [[Openbsd/Ed|ed]] if [[ksh/editor|$EDITOR]] or [[ksh/editor|$VISUAL]] are not set.%0a%0a!! Clone a repository%0a%0aTo clone a repo without encryption ('''WARNING''': insecure):%0a%0a[@%0a$ got clone git://example.com/repo.git%0a@]%0a%0aReplace @@example.com/repo.git@@ with your actual path.%0a%0aFor this guide, we will use the ngircd git repo as an example:%0a%0a[@%0a$ cd ~%0a$ got clone git://github.com/ngircd/ngircd%0a@]%0a%0aTo clone a repo using [[OpenSSH/Connect|ssh]]:%0a%0a[@%0a$ got clone ssh://example.com/repo.git%0a@]%0a%0aFor example, to clone OpenBSD's github repo:%0a%0a[@%0a$ cd /var/git/%0a$ got clone ssh://git@github.com/openbsd/src.git%0a@]%0a%0aHTTP URLs currently requires [[git/usage|git]]:%0a%0a[@%0a$ git clone https://github.com/ngircd/ngircd%0a@]%0a%0a!! Checkout code%0a%0aOnce you have a repository, you must first '''checkout'''%0athe code into a '''work tree''' before you can use it:%0a%0a[@%0a$ got checkout /path/to/repository%0a@]%0a%0aReplace @@/path/to/respository@@.%0a%0aLet's checkout the ngircd code:%0a%0a[@%0a$ cd ~%0a$ got checkout ~/ngircd.git%0a@]%0a%0aYou can check out code from a specific branch or%0acommit with @@-b@@ and @@-c@@:%0a%0a[@%0a$ got checkout -b branch -c commit /path/to/repository%0a@]%0a%0agot creates an ID SHA1 hash for every commit, so replace @@commit@@ with that hash.%0a%0aBefore we can checkout another work tree from ngircd, we must delete the old one:%0a%0a[@%0a$ rm -r ~/ngircd%0a$ got checkout -b HEAD -c f4ade537d550b872b7e86e6ffce940dfbad4c60c ~/ngircd.git%0a@]%0a%0aThis will first delete the old work tree, then check out the f4ade537d550b872b7e86e6ffce940dfbad4c60c commit from HEAD of the ngircd.git repo.%0a%0a@@got checkout@@ will show these status codes:%0a%0a|| border=1 width=50%25 class="sortable simpletable"%0a||! Status || Meaning ||%0a|| A || new file added ||%0a|| E || file already exists ||%0a%0aFor the next step, we will go ahead and delete this work tree, then check out a work tree based on the most recent commit:%0a%0a[@%0a$ rm -r ~/ngircd%0a$ got checkout ~/ngircd.git%0a@]%0a%0a!! Create a new repository%0a%0aTo create an empty repository:%0a%0a[@%0a$ got init /path/to/repository%0a@]%0a%0aReplace @@/path/to/repository@@. For example:%0a%0a[@%0a$ got init ~/ircnowd.git%0a@]%0a%0aThis will create a got repo called ircnowd.%0a%0aAfterwards, we need to import the code for the repository:%0a%0a[@%0a$ got import -m "Import sources" -r /path/to/repository /path/to/code%0a@]%0a%0a* @@-m@@ provides the log message for the import.%0a* @@-r@@ provides the repository path.%0a%0aReplace @@/path/to/repository@@ and @@/path/to/code@@. For example:%0a%0a[@%0a$ got import -m "Import sources" -r ~/ircnowd.git ~/ngircd%0a@]%0a%0aThis will import the code from @@ngircd@@ into @@ircnowd.git@@.%0a%0a!! Fetch new changes%0a%0aTo fetch changes from a remote repo:%0a%0a[@%0a$ got fetch%0a@]%0a%0a!! Add file%0a%0aTo add an unversioned file for the next commit:%0a%0a[@%0a$ got add filename%0a@]%0a%0aReplace @@filename@@. For example:%0a%0a[@%0a$ echo 'print "hello, world"' > ~/ngircd.git/hello.sh%0a$ got add ~/ngircd.git/hello.sh%0a@]%0a%0aIf adding a directory:%0a%0a[@%0a$ got add -R pathname%0a@]%0a%0a@@-R@@ allows recursion. Replace @@pathname@@.%0a%0aLet's add a directory with a file inside @@ngircd.git@@, then begin tracking the directory with got:%0a%0a[@%0a$ mkdir -p ~/ngircd.git/newcode/%0a$ echo 'print "IRCNow and Forever"' > ~/ngircd.git/newcode/ircnow.sh%0a$ got add -R ~/ngircd.git/newcode%0a@]%0a%0a!! Remove file%0a%0aTo remove a versioned file for deletion from the repo in the next commit:%0a%0a[@%0a$ got remove filename%0a@]%0a%0aReplace @@filename@@.%0a%0aLet's remove hello.sh:%0a%0a[@%0a$ got remove ~/ngircd.git/hello.sh%0a@]%0a%0aIf removing a directory:%0a%0a[@%0a$ got remove -R pathname%0a@]%0a%0a@@-R@@ allows recursion. Replace @@pathname@@.%0a%0aLet's remove the @@newcode@@ directory:%0a%0a[@%0a$ got remove -R ~/ngircd.git/newcode/%0a@]%0a%0a!! View changes%0a%0aTo view changes in a work tree:%0a%0a[@%0a$ got diff%0a@]%0a%0aIf you provide two objects, got will show the diff between just those two:%0a%0a[@%0a$ got diff object1 object2%0a@]%0a%0aReplace @@object1@@ and @@object@@ with the ID SHA1 hash.%0aFor example:%0a%0a[@%0a$ got diff ab0eb099e9c0ed60d25fb50dd78d2a638d3b49b8 f4ade537d550b872b7e86e6ffce940dfbad4c60c%0a@]%0a%0aThis will give you the diff of two files with those ID hashes.%0a%0a!! Blame%0a%0aFor a line-by-line history of a file:%0a%0a[@%0a$ got blame /path/to/file%0a@]%0a%0aUse @@-c commit@@ and replace @@committ@@ with the ID SHA1 hash to start history from that specific commit. For example:%0a%0a[@%0a$ cd ~/ngircd%0a$ got blame -c 71ae2b7d ~/ngircd/NEWS%0a@]%0a%0a!! Update%0a%0aTo update the work tree to the most recent commit on the work tree's branch:%0a%0a[@%0a$ got update%0a@]%0a%0aThis will require manual merging of files if there are conflicts.%0a%0a|| border=1 width=100%25 class="sortable simpletable"%0a||! Status || Meaning ||%0a|| U || file updated, no local changes ||%0a|| G || file updated, local changes merged ||%0a|| C || file updated, conflicts occurred during merge ||%0a|| D || file deleted ||%0a|| A || new file added ||%0a|| ~ || versioned file blocked by non-regular file ||%0a|| ! || missing versioned file restored ||%0a|| # || file not updated due to merge conflicts ||%0a|| ? || changes for an unversioned file not merged ||%0a%0a'''NOTE''': If there are staged changes, you must first commit or unstage them before using @@got update@@.%0a%0aSuppose we check out a specific commit:%0a%0a[@%0a$ cd ~%0a$ rm -r ngircd%0a$ got checkout -b HEAD -c f4ade537d550b872b7e86e6ffce940dfbad4c60c ~/ngircd.git%0a@]%0a%0aWe can then update a specific commit:%0a%0a[@%0a$ got update -c c8b12af1d2d155ec79dc2044a4ff177cf07de4fe%0a@]%0a%0a!! View status%0a%0aTo view the status of files in a work tree:%0a%0a[@%0a$ got status%0a@]%0a%0a|| border=1 width=100%25 class="sortable simpletable"%0a||! Status || Meaning ||%0a|| M || modified ||%0a|| A || added in next commit ||%0a|| D || deleted in next commit ||%0a|| C || modified or added but contains merge conflicts ||%0a|| ! || versioned file expected but missing ||%0a|| ~ || versioned file blocked by non-regular file ||%0a|| ? || unversioned item, not tracked ||%0a%0aIf changes are staged, the second column uses these codes:%0a%0a|| border=1 width=100%25 class="sortable simpletable"%0a||! Status || Meaning ||%0a|| M || modification staged ||%0a|| A || addition staged ||%0a|| D || deletion staged ||%0a%0a!! Show History%0a%0aTo show commit history:%0a%0a[@%0a$ got log%0a@]%0a%0aThis will produce a log of all commits from the current%0abranch:%0a%0a[@%0a...%0a-----------------------------------------------%0acommit ab0eb099e9c0ed60d25fb50dd78d2a638d3b49b8%0afrom: Alexander Barton %3calex@barton.de>%0adate: Tue Dec 11 22:04:21 2001 UTC%0a %0a - Test auf stdint.h (HAVE_STDINT_H) hinzugefuegt.%0a %0a-----------------------------------------------%0acommit f4ade537d550b872b7e86e6ffce940dfbad4c60c%0afrom: Alexander Barton %3calex@barton.de>%0adate: Tue Dec 11 21:53:04 2001 UTC%0a %0a Initial revision%0a@]%0a%0aTo display commits from other branches @@-b@@, starting at a%0aspecific commit @@-c@@, limited by the number of commits%0a@@-l@@:%0a%0a[@%0a$ got log -b -c commit -l N%0a@]%0a%0aReplace @@commit@@ with the ID SHA1 hash and @@N@@ with the%0anumber of commits.%0a%0aFor example:%0a%0a[@%0a$ got log -b -c 71ae2b7d7f9ae7bc02ed072c07100de0027373d6 -l 10%0a-----------------------------------------------%0acommit 71ae2b7d7f9ae7bc02ed072c07100de0027373d6 (master, origin/master, tags/rel-26.1)%0afrom: Alexander Barton %3calex@barton.de>%0adate: Sat Jan 2 13:32:48 2021 UTC%0a%0a ngIRCd Release 26.1%0a...%0a@]%0a%0aIt's also possible to show commits that match a [[https://man.openbsd.org/re_format|regular expressions]]:%0a%0a[@%0a$ got log -s regex%0a@]%0a%0aReplace @@regex@@ with a [[https://man.openbsd.org/re_format|regular expression]]:%0a%0a[@%0a$ got log -s ssl%0a-----------------------------------------------%0acommit daa88b765111b14047c97256bd2a9a2daabe123b%0afrom: Christoph Biedl %3cngircd.anoy@manchmal.in-ulm.de>%0adate: Mon Dec 5 22:51:07 2016 UTC%0avia: Alexander Barton %3calex@barton.de>%0a%0a Fix building ngIRCd with OpenSSL 1.1%0a...%0a@]%0a%0a!! Branching%0a%0aTo print the name of the current branch of the work tree:%0a%0a[@%0a$ cd /path/to/worktree%0a$ got branch%0a@]%0a%0aTo list all the branches:%0a%0a[@%0a$ got branch -l%0a@]%0a%0aInside a work tree, you can create a branch and switch to it:%0a%0a[@%0a$ got branch branchname%0a@]%0a%0aReplace @@branchname@@.%0a%0aYou can also delete a branch:%0a%0a[@%0a$ got branch -d branchename%0a@]%0a%0aOnly the branch reference @@branchname@@ is deleted; commit, tree, and blob objects remain in the repo.%0a%0aTo branch at a specific commit:%0a%0a[@%0a$ got branch -c commit branchname%0a@]%0a%0aReplace @@commit@@ with the ID SHA1 hash and replace @@branchname@@. For example:%0a%0a[@%0a$ got branch -c 02850008f4a4e8fff5799157d21ee7924345b3e1 gnutls%0a@]%0a%0aThis creates the gnutls branch of ngircd.%0a%0a!! Tags%0a%0aTo list all existing tags:%0a%0a[@%0a$ got tag -l%0a@]%0a%0aTo create a tag pointing to the most recent commit:%0a%0a[@%0a$ got tag -m "Message" tagname%0a@]%0a%0aReplace @@tagname@@ and @@Message@@.%0a%0aTo create a tag pointing to a specific commit:%0a%0a[@%0a$ got tag -c commit -m "Message" tagname%0a@]%0a%0aReplace @@commit@@ with the ID SHA1 hash and replace @@Message@@ and @@tagname@@. For example:%0a%0a[@%0a$ got tag -c 3c627dd70d032fa2c5087617da27586cf85e899a -m "Debian OpenSSL Build" debopenssl%0a@]%0a%0aThis will create the @@debopenssl@@ tag to point to commit @@3c627dd70d032fa2c5087617da27586cf85e899a@@.%0a%0a!! Revert changes%0a%0aIf you make any changes to files or folders in a work tree,%0ayou can revert those changes:%0a%0a'''WARNING''': There is no way to undo reverted changes!%0a%0a[@%0a$ got revert /path/to/file%0a@]%0a%0aReplace @@/path/to/file@@. Files added with @@got add@@%0abecome unversioned, and files deleted with @@got remove@@%0aare restored.%0a%0aTo be safe, use @@-p@@ so that got asks before reverting.%0aYou can also add @@-R@@ for recursion:%0a%0a[@%0a$ got revert -R -p /path/to/folder%0a@]%0a%0aFor example:%0a%0a[@%0a$ cd ~/ngircd%0a$ mkdir JUNK%0a$ echo "Here is some new junk" > JUNK/INFO%0a$ got add -R JUNK/%0a$ got revert -R -p JUNK/%0a@]%0a%0a!! Commit%0a%0aTo commit changes in a work tree:%0a%0a[@%0a$ got commit -m "Commit message"%0a@]%0a%0aReplace @@Commit message@@ with a commit message.%0a%0aIf changes have been staged, only staged changes will be%0acommitted.%0a%0a|| border=1 width=50%25 class="sortable simpletable"%0a||! Status || Meaning ||%0a|| M || modified file ||%0a|| D || file deleted ||%0a|| A || new file added ||%0a%0a'''NOTE''': If changes are not based on the most recent%0acommit, you may first be required to run @@got update@@%0abefore commits can be made.%0a%0a'''NOTE''': Before running @@got commit@@, make sure to set%0aup the GOT_AUTHOR environment variable (see above).%0a%0a!! Send Changes%0a%0aTo send changes to a remote repo:%0a%0a[@%0a$ got send -r ssh://path.com/to/repo%0a@]%0a%0aReplace @@ssh://path.com/to/repo@@ with the protocol and URL.%0a%0aBy default, if no remote repo is provided, the work tree's origin (its default repo) will be used.%0a%0aChanges are only be sent if they are based on up-to-date branches in the remote repo. If not, new changes must first be fetched with @@got fetch@@ and local branches must be rebased with @@got rebase@@. @@-f@@ ignores this requirement.%0a%0a'''WARNING''': Try to avoid @@-f@@ because it may result%0ain inconsistent tags in different repos.%0a%0aTo send all branches:%0a%0a[@%0a$ got send -r ssh://path.com/to/repo -a%0a@]%0a%0aReplace @@path.com/to/repo@@. To specify a specific branch:%0a%0a[@%0a$ got send -r ssh://path.com/to/repo -b branchname%0a@]%0a%0aReplace @@branchname@@. To delete a branch (only references%0aare deleted):%0a%0a[@%0a$ got send -r ssh://path.com/to/repo -d branchname%0a@]%0a%0a!! Rebase%0a%0aWhen you have multiple branches, you may want to rebase%0athe commits of one branch onto your current branch:%0a%0a[@%0a$ got rebase branchname%0a@]%0a%0aReplace @@branchname@@. Note that @@branchname@@ must have a%0acommon ancestor with the current branch.%0a%0aCommits from @@branchname@@ are made to the work tree's current branch.%0a%0aTo show a list of past rebases:%0a%0a[@%0a$ got rebase -l%0a@]%0a%0a!! Staging%0a%0aTo stage for the next commit:%0a%0a[@%0a$ got stage%0a@]%0a%0aTo stage just one file:%0a%0a[@%0a$ got stage /path/to/file%0a@]%0a%0astage [-l] [-p] [-F response-script] [-S] [path ...]%0a|| border=1 width=50%25 class="sortable simpletable"%0a||! Status || Meaning ||%0a|| A || addition staged ||%0a|| M || modification staged ||%0a|| D || deletion staged ||%0a%0aIf there are staged changes, got commit will not commit%0aany paths that do not have staged changes.%0a%0aTo list staged changes:%0a%0a[@%0a$ got stage -l%0a@]%0a%0aIf a file is out of date compared with the work tree's current branch, you must run @@got update@@ before staging.%0a%0aTo unstage all changes:%0a%0a[@%0a$ got unstage%0a@]%0a%0aTo unstage a single file:%0a%0a[@%0a$ got unstage /path/to/file%0a@]%0a%0a!! Info%0a%0aTo show metadata about a work tree:%0a%0a[@%0a$ got info%0a@]%0a%0aTo show additional data about a file:%0a%0a[@%0a$ got info /path/to/file%0a@]%0a time=1639759456 title=Game of Trees author:1639759456=jrmu diff:1639759456:1636906130:=513c513%0a%3c $ got commit -m "Commit message"%0a---%0a> $ got -m "Commit message" commit%0a host:1639759456=198.251.82.194 author:1636906130=jrmu diff:1636906130:1636904658:=621,646d620%0a%3c %0a%3c To unstage all changes:%0a%3c %0a%3c [@%0a%3c $ got unstage%0a%3c @]%0a%3c %0a%3c To unstage a single file:%0a%3c %0a%3c [@%0a%3c $ got unstage /path/to/file%0a%3c @]%0a%3c %0a%3c !! Info%0a%3c %0a%3c To show metadata about a work tree:%0a%3c %0a%3c [@%0a%3c $ got info%0a%3c @]%0a%3c %0a%3c To show additional data about a file:%0a%3c %0a%3c [@%0a%3c $ got info /path/to/file%0a%3c @]%0a host:1636906130=38.87.162.8 author:1636904658=jrmu diff:1636904658:1636904493:= host:1636904658=38.87.162.8 author:1636904493=jrmu diff:1636904493:1636900066:=589,620d588%0a%3c %0a%3c !! Staging%0a%3c %0a%3c To stage for the next commit:%0a%3c %0a%3c [@%0a%3c $ got stage%0a%3c @]%0a%3c %0a%3c To stage just one file:%0a%3c %0a%3c [@%0a%3c $ got stage /path/to/file%0a%3c @]%0a%3c %0a%3c stage [-l] [-p] [-F response-script] [-S] [path ...]%0a%3c || border=1 width=50%25 class="sortable simpletable"%0a%3c ||! Status || Meaning ||%0a%3c || A || addition staged ||%0a%3c || M || modification staged ||%0a%3c || D || deletion staged ||%0a%3c %0a%3c If there are staged changes, got commit will not commit%0a%3c any paths that do not have staged changes.%0a%3c %0a%3c To list staged changes:%0a%3c %0a%3c [@%0a%3c $ got stage -l%0a%3c @]%0a%3c %0a%3c If a file is out of date compared with the work tree's current branch, you must run @@got update@@ before staging.%0a host:1636904493=38.87.162.8 author:1636900066=jrmu diff:1636900066:1636899968:=588a589%0a> %0a host:1636900066=38.87.162.8 author:1636899968=jrmu diff:1636899968:1636899775:=576c576%0a%3c $ got rebase branchname%0a---%0a> $ got rebase %0a578c578,579%0a%3c %0a---%0a> rebase [-a] [-c] [-l] [-X] [branch]%0a> %0a583,589d583%0a%3c %0a%3c To show a list of past rebases:%0a%3c %0a%3c [@%0a%3c $ got rebase -l%0a%3c @]%0a%3c %0a host:1636899968=38.87.162.8 author:1636899775=jrmu diff:1636899775:1636893644:=569,583d568%0a%3c %0a%3c !! Rebase%0a%3c %0a%3c When you have multiple branches, you may want to rebase%0a%3c the commits of one branch onto your current branch:%0a%3c %0a%3c [@%0a%3c $ got rebase %0a%3c @]%0a%3c rebase [-a] [-c] [-l] [-X] [branch]%0a%3c %0a%3c Replace @@branchname@@. Note that @@branchname@@ must have a%0a%3c common ancestor with the current branch.%0a%3c %0a%3c Commits from @@branchname@@ are made to the work tree's current branch.%0a host:1636899775=38.87.162.8 author:1636893644=jrmu diff:1636893644:1636892178:=548,568c548,549%0a%3c '''WARNING''': Try to avoid @@-f@@ because it may result%0a%3c in inconsistent tags in different repos.%0a%3c %0a%3c To send all branches:%0a%3c %0a%3c [@%0a%3c $ got send -r ssh://path.com/to/repo -a%0a%3c @]%0a%3c %0a%3c Replace @@path.com/to/repo@@. To specify a specific branch:%0a%3c %0a%3c [@%0a%3c $ got send -r ssh://path.com/to/repo -b branchname%0a%3c @]%0a%3c %0a%3c Replace @@branchname@@. To delete a branch (only references%0a%3c are deleted):%0a%3c %0a%3c [@%0a%3c $ got send -r ssh://path.com/to/repo -d branchname%0a%3c @]%0a---%0a> send [-a] [-b branch] [-d branch] [-f] [-r repository-path] [-t tag] [-T] [-q] [-v] [remote-repository]%0a> %0a host:1636893644=38.87.162.47 author:1636892178=jrmu diff:1636892178:1636881065:=533,549d532%0a%3c %0a%3c !! Send Changes%0a%3c %0a%3c To send changes to a remote repo:%0a%3c %0a%3c [@%0a%3c $ got send -r ssh://path.com/to/repo%0a%3c @]%0a%3c %0a%3c Replace @@ssh://path.com/to/repo@@ with the protocol and URL.%0a%3c %0a%3c By default, if no remote repo is provided, the work tree's origin (its default repo) will be used.%0a%3c %0a%3c Changes are only be sent if they are based on up-to-date branches in the remote repo. If not, new changes must first be fetched with @@got fetch@@ and local branches must be rebased with @@got rebase@@. @@-f@@ ignores this requirement.%0a%3c %0a%3c send [-a] [-b branch] [-d branch] [-f] [-r repository-path] [-t tag] [-T] [-q] [-v] [remote-repository]%0a%3c %0a host:1636892178=38.87.162.47 author:1636881065=jrmu diff:1636881065:1636865869:=509,532d508%0a%3c %0a%3c To commit changes in a work tree:%0a%3c %0a%3c [@%0a%3c $ got -m "Commit message" commit%0a%3c @]%0a%3c %0a%3c Replace @@Commit message@@ with a commit message.%0a%3c %0a%3c If changes have been staged, only staged changes will be%0a%3c committed.%0a%3c %0a%3c || border=1 width=50%25 class="sortable simpletable"%0a%3c ||! Status || Meaning ||%0a%3c || M || modified file ||%0a%3c || D || file deleted ||%0a%3c || A || new file added ||%0a%3c %0a%3c '''NOTE''': If changes are not based on the most recent%0a%3c commit, you may first be required to run @@got update@@%0a%3c before commits can be made.%0a%3c %0a%3c '''NOTE''': Before running @@got commit@@, make sure to set%0a%3c up the GOT_AUTHOR environment variable (see above).%0a host:1636881065=38.87.162.47 author:1636865869=jrmu diff:1636865869:1636865826:=504,505c504%0a%3c $ got add -R JUNK/%0a%3c $ got revert -R -p JUNK/%0a---%0a> $ got revert -R -p JUNK%0a host:1636865869=38.87.162.47 author:1636865826=jrmu diff:1636865826:1636865547:=495c495%0a%3c $ got revert -R -p /path/to/folder%0a---%0a> $ got revert -p /path/to/folder -R%0a504c504%0a%3c $ got revert -R -p JUNK%0a---%0a> $ got revert -p JUNK -R%0a host:1636865826=38.87.162.47 author:1636865547=jrmu diff:1636865547:1636865539:= host:1636865547=38.87.162.47 author:1636865539=jrmu diff:1636865539:1636864255:=475,507d474%0a%3c %0a%3c !! Revert changes%0a%3c %0a%3c If you make any changes to files or folders in a work tree,%0a%3c you can revert those changes:%0a%3c %0a%3c '''WARNING''': There is no way to undo reverted changes!%0a%3c %0a%3c [@%0a%3c $ got revert /path/to/file%0a%3c @]%0a%3c %0a%3c Replace @@/path/to/file@@. Files added with @@got add@@%0a%3c become unversioned, and files deleted with @@got remove@@%0a%3c are restored.%0a%3c %0a%3c To be safe, use @@-p@@ so that got asks before reverting.%0a%3c You can also add @@-R@@ for recursion:%0a%3c %0a%3c [@%0a%3c $ got revert -p /path/to/folder -R%0a%3c @]%0a%3c %0a%3c For example:%0a%3c %0a%3c [@%0a%3c $ cd ~/ngircd%0a%3c $ mkdir JUNK%0a%3c $ echo "Here is some new junk" > JUNK/INFO%0a%3c $ got revert -p JUNK -R%0a%3c @]%0a%3c %0a%3c !! Commit%0a host:1636865539=38.87.162.47 author:1636864255=jrmu diff:1636864255:1636863905:=470,474c470,472%0a%3c [@%0a%3c $ got tag -c 3c627dd70d032fa2c5087617da27586cf85e899a -m "Debian OpenSSL Build" debopenssl%0a%3c @]%0a%3c %0a%3c This will create the @@debopenssl@@ tag to point to commit @@3c627dd70d032fa2c5087617da27586cf85e899a@@.%0a---%0a> %0a> Attempt to create a tag with the given name, and make this tag point at the given commit. If no commit is specified, default to the latest commit on the work tree's current branch if invoked in a work tree, and to a commit resolved via the repository's HEAD reference otherwise.%0a> %0a host:1636864255=38.87.162.47 author:1636863905=jrmu diff:1636863905:1636863135:=445,472d444%0a%3c %0a%3c !! Tags%0a%3c %0a%3c To list all existing tags:%0a%3c %0a%3c [@%0a%3c $ got tag -l%0a%3c @]%0a%3c %0a%3c To create a tag pointing to the most recent commit:%0a%3c %0a%3c [@%0a%3c $ got tag -m "Message" tagname%0a%3c @]%0a%3c %0a%3c Replace @@tagname@@ and @@Message@@.%0a%3c %0a%3c To create a tag pointing to a specific commit:%0a%3c %0a%3c [@%0a%3c $ got tag -c commit -m "Message" tagname%0a%3c @]%0a%3c %0a%3c Replace @@commit@@ with the ID SHA1 hash and replace @@Message@@ and @@tagname@@. For example:%0a%3c %0a%3c %0a%3c Attempt to create a tag with the given name, and make this tag point at the given commit. If no commit is specified, default to the latest commit on the work tree's current branch if invoked in a work tree, and to a commit resolved via the repository's HEAD reference otherwise.%0a%3c %0a host:1636863905=38.87.162.47 author:1636863135=jrmu diff:1636863135:1636862621:=438,444c438%0a%3c Replace @@commit@@ with the ID SHA1 hash and replace @@branchname@@. For example:%0a%3c %0a%3c [@%0a%3c $ got branch -c 02850008f4a4e8fff5799157d21ee7924345b3e1 gnutls%0a%3c @]%0a%3c %0a%3c This creates the gnutls branch of ngircd.%0a---%0a> Replace @@commit@@ with the ID SHA1 hash and replace @@branchname@@.%0a host:1636863135=38.87.162.47 author:1636862621=jrmu diff:1636862621:1636861264:=400,438d399%0a%3c %0a%3c !! Branching%0a%3c %0a%3c To print the name of the current branch of the work tree:%0a%3c %0a%3c [@%0a%3c $ cd /path/to/worktree%0a%3c $ got branch%0a%3c @]%0a%3c %0a%3c To list all the branches:%0a%3c %0a%3c [@%0a%3c $ got branch -l%0a%3c @]%0a%3c %0a%3c Inside a work tree, you can create a branch and switch to it:%0a%3c %0a%3c [@%0a%3c $ got branch branchname%0a%3c @]%0a%3c %0a%3c Replace @@branchname@@.%0a%3c %0a%3c You can also delete a branch:%0a%3c %0a%3c [@%0a%3c $ got branch -d branchename%0a%3c @]%0a%3c %0a%3c Only the branch reference @@branchname@@ is deleted; commit, tree, and blob objects remain in the repo.%0a%3c %0a%3c To branch at a specific commit:%0a%3c %0a%3c [@%0a%3c $ got branch -c commit branchname%0a%3c @]%0a%3c %0a%3c Replace @@commit@@ with the ID SHA1 hash and replace @@branchname@@.%0a host:1636862621=38.87.162.47 author:1636861264=jrmu diff:1636861264:1636860852:= host:1636861264=38.87.162.47 author:1636860852=jrmu diff:1636860852:1636860791:= host:1636860852=38.87.162.47 author:1636860791=jrmu diff:1636860791:1636821654:=249,263d248%0a%3c %0a%3c !! Blame%0a%3c %0a%3c For a line-by-line history of a file:%0a%3c %0a%3c [@%0a%3c $ got blame /path/to/file%0a%3c @]%0a%3c %0a%3c Use @@-c commit@@ and replace @@committ@@ with the ID SHA1 hash to start history from that specific commit. For example:%0a%3c %0a%3c [@%0a%3c $ cd ~/ngircd%0a%3c $ got blame -c 71ae2b7d ~/ngircd/NEWS%0a%3c @]%0a host:1636860791=38.87.162.47 author:1636821654=jrmu diff:1636821654:1636821470:= host:1636821654=38.87.162.47 author:1636821470=jrmu diff:1636821470:1636819727:=320,383d319%0a%3c @]%0a%3c %0a%3c This will produce a log of all commits from the current%0a%3c branch:%0a%3c %0a%3c [@%0a%3c ...%0a%3c -----------------------------------------------%0a%3c commit ab0eb099e9c0ed60d25fb50dd78d2a638d3b49b8%0a%3c from: Alexander Barton %3calex@barton.de>%0a%3c date: Tue Dec 11 22:04:21 2001 UTC%0a%3c %0a%3c - Test auf stdint.h (HAVE_STDINT_H) hinzugefuegt.%0a%3c %0a%3c -----------------------------------------------%0a%3c commit f4ade537d550b872b7e86e6ffce940dfbad4c60c%0a%3c from: Alexander Barton %3calex@barton.de>%0a%3c date: Tue Dec 11 21:53:04 2001 UTC%0a%3c %0a%3c Initial revision%0a%3c @]%0a%3c %0a%3c To display commits from other branches @@-b@@, starting at a%0a%3c specific commit @@-c@@, limited by the number of commits%0a%3c @@-l@@:%0a%3c %0a%3c [@%0a%3c $ got log -b -c commit -l N%0a%3c @]%0a%3c %0a%3c Replace @@commit@@ with the ID SHA1 hash and @@N@@ with the%0a%3c number of commits.%0a%3c %0a%3c For example:%0a%3c %0a%3c [@%0a%3c $ got log -b -c 71ae2b7d7f9ae7bc02ed072c07100de0027373d6 -l 10%0a%3c -----------------------------------------------%0a%3c commit 71ae2b7d7f9ae7bc02ed072c07100de0027373d6 (master, origin/master, tags/rel-26.1)%0a%3c from: Alexander Barton %3calex@barton.de>%0a%3c date: Sat Jan 2 13:32:48 2021 UTC%0a%3c %0a%3c ngIRCd Release 26.1%0a%3c ...%0a%3c @]%0a%3c %0a%3c It's also possible to show commits that match a [[https://man.openbsd.org/re_format|regular expressions]]:%0a%3c %0a%3c [@%0a%3c $ got log -s regex%0a%3c @]%0a%3c %0a%3c Replace @@regex@@ with a [[https://man.openbsd.org/re_format|regular expression]]:%0a%3c %0a%3c [@%0a%3c $ got log -s ssl%0a%3c -----------------------------------------------%0a%3c commit daa88b765111b14047c97256bd2a9a2daabe123b%0a%3c from: Christoph Biedl %3cngircd.anoy@manchmal.in-ulm.de>%0a%3c date: Mon Dec 5 22:51:07 2016 UTC%0a%3c via: Alexander Barton %3calex@barton.de>%0a%3c %0a%3c Fix building ngIRCd with OpenSSL 1.1%0a%3c ...%0a host:1636821470=38.87.162.47 author:1636819727=jrmu diff:1636819727:1636819392:= host:1636819727=38.87.162.47 author:1636819392=jrmu diff:1636819392:1636814281:=274,275c274,275%0a%3c Suppose we check out a specific commit:%0a%3c %0a---%0a> You can also specify the branch and commit:%0a> %0a277,285c277%0a%3c $ cd ~%0a%3c $ rm -r ngircd%0a%3c $ got checkout -b HEAD -c f4ade537d550b872b7e86e6ffce940dfbad4c60c ~/ngircd.git%0a%3c @]%0a%3c %0a%3c We can then update a specific commit:%0a%3c %0a%3c [@%0a%3c $ got update -c c8b12af1d2d155ec79dc2044a4ff177cf07de4fe%0a---%0a> $ got update -b ssl-log-messages%0a host:1636819392=38.87.162.47 author:1636814281=jrmu diff:1636814281:1636811090:=252c252%0a%3c To update the work tree to the most recent commit on the work tree's branch:%0a---%0a> To update the work tree to the most recent commit:%0a host:1636814281=38.87.162.47 author:1636811090=jrmu diff:1636811090:1636421427:=59c59%0a%3c $ got clone ssh://example.com/repo.git%0a---%0a> $ got clone git+ssh://example.com/repo.git%0a host:1636811090=38.87.162.47 author:1636421427=mkf csum:1636421427=BSD -> bsd >:( diff:1636421427:1636421250:minor=37c37%0a%3c By default, got uses the text editor [[Openbsd/Ed|ed]] if [[ksh/editor|$EDITOR]] or [[ksh/editor|$VISUAL]] are not set.%0a---%0a> By default, got uses the text editor [[OpenBSD/Ed|ed]] if [[ksh/editor|$EDITOR]] or [[ksh/editor|$VISUAL]] are not set.%0a host:1636421427=5.238.160.208 author:1636421250=mkf csum:1636421250=ed -> Ed diff:1636421250:1636421046:minor=37c37%0a%3c By default, got uses the text editor [[OpenBSD/Ed|ed]] if [[ksh/editor|$EDITOR]] or [[ksh/editor|$VISUAL]] are not set.%0a---%0a> By default, got uses the text editor [[OpenBSD/ed|ed]] if [[ksh/editor|$EDITOR]] or [[ksh/editor|$VISUAL]] are not set.%0a host:1636421250=5.238.160.208 author:1636421046=mkf diff:1636421046:1636421044:= host:1636421046=5.238.160.208 author:1636421044=mkf diff:1636421044:1636381150:=37c37%0a%3c By default, got uses the text editor [[OpenBSD/ed|ed]] if [[ksh/editor|$EDITOR]] or [[ksh/editor|$VISUAL]] are not set.%0a---%0a> By default, got uses the text editor [[ed/usage|ed]] if [[ksh/editor|$EDITOR]] or [[ksh/editor|$VISUAL]] are not set.%0a host:1636421044=5.238.160.208 author:1636381150=jrmu diff:1636381150:1636379361:=118,119c118,122%0a%3c For the next step, we will go ahead and delete this work tree, then check out a work tree based on the most recent commit:%0a%3c %0a---%0a> %0a> !! Create a new repository%0a> %0a> To create an empty repository:%0a> %0a121,122c124%0a%3c $ rm -r ~/ngircd%0a%3c $ got checkout ~/ngircd.git%0a---%0a> $ got init /path/to/repository%0a125,128c127,130%0a%3c !! Create a new repository%0a%3c %0a%3c To create an empty repository:%0a%3c %0a---%0a> Replace @@/path/to/repository@@.%0a> %0a> For example:%0a> %0a130c132%0a%3c $ got init /path/to/repository%0a---%0a> $ got init ~/ircnow-got%0a133,134c135,138%0a%3c Replace @@/path/to/repository@@. For example:%0a%3c %0a---%0a> This will create a got repo called ircnow-got.%0a> %0a> Afterwards, we need to import the code for the repository:%0a> %0a136c140%0a%3c $ got init ~/ircnowd.git%0a---%0a> $ got import -m "Import sources" -r /path/to/repository /path/to/code%0a139,146d142%0a%3c This will create a got repo called ircnowd.%0a%3c %0a%3c Afterwards, we need to import the code for the repository:%0a%3c %0a%3c [@%0a%3c $ got import -m "Import sources" -r /path/to/repository /path/to/code%0a%3c @]%0a%3c %0a150,151c146,149%0a%3c Replace @@/path/to/repository@@ and @@/path/to/code@@. For example:%0a%3c %0a---%0a> Replace @@/path/to/repository@@ and @@/path/to/code@@.%0a> %0a> For example:%0a> %0a153c151%0a%3c $ got import -m "Import sources" -r ~/ircnowd.git ~/ngircd%0a---%0a> $ got import -m "Import sources" -r ~/ircnow-got ~/ircnow-code%0a156c154%0a%3c This will import the code from @@ngircd@@ into @@ircnowd.git@@.%0a---%0a> This will import the code from @@ircnow-code@@ into @@ircnow-got@@.%0a host:1636381150=38.87.162.47 author:1636379361=jrmu diff:1636379361:1636379116:=47,50d46%0a%3c Replace @@example.com/repo.git@@ with your actual path.%0a%3c %0a%3c For this guide, we will use the ngircd git repo as an example:%0a%3c %0a75,79c71,74%0a%3c !! Checkout code%0a%3c %0a%3c Once you have a repository, you must first '''checkout'''%0a%3c the code into a '''work tree''' before you can use it:%0a%3c %0a---%0a> !! Create a new repository%0a> %0a> To create an empty repository:%0a> %0a81c76%0a%3c $ got checkout /path/to/repository%0a---%0a> $ got init /path/to/repository%0a84,87c79,82%0a%3c Replace @@/path/to/respository@@.%0a%3c %0a%3c Let's checkout the ngircd code:%0a%3c %0a---%0a> Replace @@/path/to/repository@@.%0a> %0a> For example:%0a> %0a89,90c84%0a%3c $ cd ~%0a%3c $ got checkout ~/ngircd.git%0a---%0a> $ got init ~/ircnow-got%0a93,95c87,90%0a%3c You can check out code from a specific branch or%0a%3c commit with @@-b@@ and @@-c@@:%0a%3c %0a---%0a> This will create a got repo called ircnow-got.%0a> %0a> Afterwards, we need to import the code for the repository:%0a> %0a97c92%0a%3c $ got checkout -b branch -c commit /path/to/repository%0a---%0a> $ got import -m "Import sources" -r /path/to/repository /path/to/code%0a100,103c95,101%0a%3c got creates an ID SHA1 hash for every commit, so replace @@commit@@ with that hash.%0a%3c %0a%3c Before we can checkout another work tree from ngircd, we must delete the old one:%0a%3c %0a---%0a> * @@-m@@ provides the log message for the import.%0a> * @@-r@@ provides the repository path.%0a> %0a> Replace @@/path/to/repository@@ and @@/path/to/code@@.%0a> %0a> For example:%0a> %0a105,106c103%0a%3c $ rm -r ~/ngircd%0a%3c $ got checkout -b HEAD -c f4ade537d550b872b7e86e6ffce940dfbad4c60c ~/ngircd.git%0a---%0a> $ got import -m "Import sources" -r ~/ircnow-got ~/ircnow-code%0a109,122c106,111%0a%3c This will first delete the old work tree, then check out the f4ade537d550b872b7e86e6ffce940dfbad4c60c commit from HEAD of the ngircd.git repo.%0a%3c %0a%3c @@got checkout@@ will show these status codes:%0a%3c %0a%3c || border=1 width=50%25 class="sortable simpletable"%0a%3c ||! Status || Meaning ||%0a%3c || A || new file added ||%0a%3c || E || file already exists ||%0a%3c %0a%3c %0a%3c !! Create a new repository%0a%3c %0a%3c To create an empty repository:%0a%3c %0a---%0a> This will import the code from @@ircnow-code@@ into @@ircnow-got@@.%0a> %0a> !! Fetch new changes%0a> %0a> To fetch changes from a remote repo:%0a> %0a124c113%0a%3c $ got init /path/to/repository%0a---%0a> $ got fetch%0a127,130c116,120%0a%3c Replace @@/path/to/repository@@.%0a%3c %0a%3c For example:%0a%3c %0a---%0a> !! Checkout code%0a> %0a> Once you have a repository, you must first '''checkout'''%0a> the code into a '''work tree''' before you can use it:%0a> %0a132c122%0a%3c $ got init ~/ircnow-got%0a---%0a> $ got checkout /path/to/repository%0a135,138c125,128%0a%3c This will create a got repo called ircnow-got.%0a%3c %0a%3c Afterwards, we need to import the code for the repository:%0a%3c %0a---%0a> Replace @@/path/to/respository@@.%0a> %0a> Let's checkout the ngircd code:%0a> %0a140c130,131%0a%3c $ got import -m "Import sources" -r /path/to/repository /path/to/code%0a---%0a> $ cd ~%0a> $ got checkout ~/ngircd.git%0a143,149c134,136%0a%3c * @@-m@@ provides the log message for the import.%0a%3c * @@-r@@ provides the repository path.%0a%3c %0a%3c Replace @@/path/to/repository@@ and @@/path/to/code@@.%0a%3c %0a%3c For example:%0a%3c %0a---%0a> You can check out code from a specific branch or%0a> commit with @@-b@@ and @@-c@@:%0a> %0a151c138%0a%3c $ got import -m "Import sources" -r ~/ircnow-got ~/ircnow-code%0a---%0a> $ got checkout -b branch -c commit /path/to/repository%0a154,159c141,144%0a%3c This will import the code from @@ircnow-code@@ into @@ircnow-got@@.%0a%3c %0a%3c !! Fetch new changes%0a%3c %0a%3c To fetch changes from a remote repo:%0a%3c %0a---%0a> got creates an ID SHA1 hash for every commit, so replace @@commit@@ with that hash.%0a> %0a> Before we can checkout another work tree from ngircd, we must delete the old one:%0a> %0a161c146,147%0a%3c $ got fetch%0a---%0a> $ rm -r ~/ngircd%0a> $ got checkout -b HEAD -c f4ade537d550b872b7e86e6ffce940dfbad4c60c ~/ngircd.git%0a162a149,157%0a> %0a> This will first delete the old work tree, then check out the f4ade537d550b872b7e86e6ffce940dfbad4c60c commit from HEAD of the ngircd.git repo.%0a> %0a> @@got checkout@@ will show these status codes:%0a> %0a> || border=1 width=50%25 class="sortable simpletable"%0a> ||! Status || Meaning ||%0a> || A || new file added ||%0a> || E || file already exists ||%0a host:1636379361=38.87.162.47 author:1636379116=jrmu diff:1636379116:1636378801:=39,42c39,42%0a%3c !! Clone a repository%0a%3c %0a%3c To clone a repo without encryption ('''WARNING''': insecure):%0a%3c %0a---%0a> !! Create a new repository%0a> %0a> To create an empty repository:%0a> %0a44c44%0a%3c $ got clone git://example.com/repo.git%0a---%0a> $ got init /path/to/repository%0a46a47,50%0a> Replace @@/path/to/repository@@.%0a> %0a> For example:%0a> %0a48,49c52%0a%3c $ cd ~%0a%3c $ got clone git://github.com/ngircd/ngircd%0a---%0a> $ got init ~/ircnow-got%0a52,53c55,58%0a%3c To clone a repo using [[OpenSSH/Connect|ssh]]:%0a%3c %0a---%0a> This will create a got repo called ircnow-got.%0a> %0a> Afterwards, we need to import the code for the repository:%0a> %0a55c60%0a%3c $ got clone git+ssh://example.com/repo.git%0a---%0a> $ got import -m "Import sources" -r /path/to/repository /path/to/code%0a58,59c63,69%0a%3c For example, to clone OpenBSD's github repo:%0a%3c %0a---%0a> * @@-m@@ provides the log message for the import.%0a> * @@-r@@ provides the repository path.%0a> %0a> Replace @@/path/to/repository@@ and @@/path/to/code@@.%0a> %0a> For example:%0a> %0a61,62c71%0a%3c $ cd /var/git/%0a%3c $ got clone ssh://git@github.com/openbsd/src.git%0a---%0a> $ got import -m "Import sources" -r ~/ircnow-got ~/ircnow-code%0a65,66c74,79%0a%3c HTTP URLs currently requires [[git/usage|git]]:%0a%3c %0a---%0a> This will import the code from @@ircnow-code@@ into @@ircnow-got@@.%0a> %0a> !! Clone a repository%0a> %0a> To clone a repo without encryption ('''WARNING''': insecure):%0a> %0a68c81%0a%3c $ git clone https://github.com/ngircd/ngircd%0a---%0a> $ got clone git://example.com/repo.git%0a71,74d83%0a%3c !! Create a new repository%0a%3c %0a%3c To create an empty repository:%0a%3c %0a76c85,86%0a%3c $ got init /path/to/repository%0a---%0a> $ cd ~%0a> $ got clone git://github.com/ngircd/ngircd%0a79,82c89,90%0a%3c Replace @@/path/to/repository@@.%0a%3c %0a%3c For example:%0a%3c %0a---%0a> To clone a repo using [[OpenSSH/Connect|ssh]]:%0a> %0a84c92%0a%3c $ got init ~/ircnow-got%0a---%0a> $ got clone git+ssh://example.com/repo.git%0a87,90c95,96%0a%3c This will create a got repo called ircnow-got.%0a%3c %0a%3c Afterwards, we need to import the code for the repository:%0a%3c %0a---%0a> For example, to clone OpenBSD's github repo:%0a> %0a92c98,99%0a%3c $ got import -m "Import sources" -r /path/to/repository /path/to/code%0a---%0a> $ cd /var/git/%0a> $ got clone ssh://git@github.com/openbsd/src.git%0a95,101c102,103%0a%3c * @@-m@@ provides the log message for the import.%0a%3c * @@-r@@ provides the repository path.%0a%3c %0a%3c Replace @@/path/to/repository@@ and @@/path/to/code@@.%0a%3c %0a%3c For example:%0a%3c %0a---%0a> HTTP URLs currently requires [[git/usage|git]]:%0a> %0a103c105%0a%3c $ got import -m "Import sources" -r ~/ircnow-got ~/ircnow-code%0a---%0a> $ git clone https://github.com/ngircd/ngircd%0a105,106d106%0a%3c %0a%3c This will import the code from @@ircnow-code@@ into @@ircnow-got@@.%0a host:1636379116=38.87.162.47 author:1636378801=jrmu diff:1636378801:1636378787:= host:1636378801=38.87.162.47 author:1636378787=jrmu diff:1636378787:1636377358:=34c34%0a%3c $ echo 'set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)' >> ~/.profile%0a---%0a> $ echo "set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)" >> ~/.profile%0a host:1636378787=38.87.162.47 author:1636377358=jrmu diff:1636377358:1636359404:=17c17%0a%3c !! Configuring got%0a---%0a> !! Configuring Got%0a host:1636377358=198.251.82.194 author:1636359404=jrmu diff:1636359404:1636359048:=143,144c143,144%0a%3c Before we can checkout another work tree from ngircd, we must delete the old one:%0a%3c %0a---%0a> For example:%0a> %0a146d145%0a%3c $ rm -r ~/ngircd%0a150,151c149,150%0a%3c This will first delete the old work tree, then check out the f4ade537d550b872b7e86e6ffce940dfbad4c60c commit from HEAD of the ngircd.git repo.%0a%3c %0a---%0a> This will check out the f4ade537d550b872b7e86e6ffce940dfbad4c60c commit from HEAD of the ngircd.git repo.%0a> %0a167,168c166,167%0a%3c Replace @@filename@@. For example:%0a%3c %0a---%0a> Replace @@filename@@. If adding a directory:%0a> %0a170,171c169%0a%3c $ echo 'print "hello, world"' > ~/ngircd.git/hello.sh%0a%3c $ got add ~/ngircd.git/hello.sh%0a---%0a> $ got add -R pathname%0a174,179d171%0a%3c If adding a directory:%0a%3c %0a%3c [@%0a%3c $ got add -R pathname%0a%3c @]%0a%3c %0a186c178%0a%3c $ echo 'print "IRCNow and Forever"' > ~/ngircd.git/newcode/ircnow.sh%0a---%0a> $ echo 'print "hello, world"' > ~/ngircd.git/newcode/hello.sh%0a198,201c190,191%0a%3c Replace @@filename@@.%0a%3c %0a%3c Let's remove hello.sh:%0a%3c %0a---%0a> Replace @@filename@@. If removing a directory:%0a> %0a203c193%0a%3c $ got remove ~/ngircd.git/hello.sh%0a---%0a> $ got remove -R pathname%0a206,211d195%0a%3c If removing a directory:%0a%3c %0a%3c [@%0a%3c $ got remove -R pathname%0a%3c @]%0a%3c %0a213,218d196%0a%3c %0a%3c Let's remove the @@newcode@@ directory:%0a%3c %0a%3c [@%0a%3c $ got remove -R ~/ngircd.git/newcode/%0a%3c @]%0a host:1636359404=198.251.82.194 author:1636359048=jrmu diff:1636359048:1636358875:=126,132d125%0a%3c %0a%3c Let's checkout the ngircd code:%0a%3c %0a%3c [@%0a%3c $ cd ~%0a%3c $ got checkout ~/ngircd.git%0a%3c @]%0a host:1636359048=198.251.82.194 author:1636358875=jrmu diff:1636358875:1636358870:= host:1636358875=198.251.82.194 author:1636358870=jrmu diff:1636358870:1636358526:=49,50c49,50%0a%3c For example:%0a%3c %0a---%0a> Afterwards, we need to import the code for the repository:%0a> %0a52c52%0a%3c $ got init ~/ircnow-got%0a---%0a> $ got import -m "Import sources" -r /path/to/repository /path/to/code%0a55,62d54%0a%3c This will create a got repo called ircnow-got.%0a%3c %0a%3c Afterwards, we need to import the code for the repository:%0a%3c %0a%3c [@%0a%3c $ got import -m "Import sources" -r /path/to/repository /path/to/code%0a%3c @]%0a%3c %0a68,69c60,64%0a%3c For example:%0a%3c %0a---%0a> %0a> !! Clone a repository%0a> %0a> To clone a repo without encryption ('''WARNING''': insecure):%0a> %0a71c66%0a%3c $ got import -m "Import sources" -r ~/ircnow-got ~/ircnow-code%0a---%0a> $ got clone git://example.com/repo.git%0a74,79c69,71%0a%3c This will import the code from @@ircnow-code@@ into @@ircnow-got@@.%0a%3c %0a%3c !! Clone a repository%0a%3c %0a%3c To clone a repo without encryption ('''WARNING''': insecure):%0a%3c %0a---%0a> For the rest of the guide, we will be working with%0a> ngircd's git repo, so let's clone that to our home directory:%0a> %0a81c73,74%0a%3c $ got clone git://example.com/repo.git%0a---%0a> $ cd ~%0a> $ got clone git://github.com/ngircd/ngircd%0a83a77,78%0a> To clone a repo using [[OpenSSH/Connect|ssh]]:%0a> %0a85,86c80%0a%3c $ cd ~%0a%3c $ got clone git://github.com/ngircd/ngircd%0a---%0a> $ got clone git+ssh://example.com/repo.git%0a89,90c83,84%0a%3c To clone a repo using [[OpenSSH/Connect|ssh]]:%0a%3c %0a---%0a> For example, to clone OpenBSD's github repo:%0a> %0a92c86,87%0a%3c $ got clone git+ssh://example.com/repo.git%0a---%0a> $ cd /var/git/%0a> $ got clone ssh://git@github.com/openbsd/src.git%0a95,96c90,91%0a%3c For example, to clone OpenBSD's github repo:%0a%3c %0a---%0a> HTTP URLs currently requires [[git/usage|git]]:%0a> %0a98,99c93%0a%3c $ cd /var/git/%0a%3c $ got clone ssh://git@github.com/openbsd/src.git%0a---%0a> $ git clone https://github.com/ngircd/ngircd%0a102,107d95%0a%3c HTTP URLs currently requires [[git/usage|git]]:%0a%3c %0a%3c [@%0a%3c $ git clone https://github.com/ngircd/ngircd%0a%3c @]%0a%3c %0a166,173d153%0a%3c %0a%3c Let's add a directory with a file inside @@ngircd.git@@, then begin tracking the directory with got:%0a%3c %0a%3c [@%0a%3c $ mkdir -p ~/ngircd.git/newcode/%0a%3c $ echo 'print "hello, world"' > ~/ngircd.git/newcode/hello.sh%0a%3c $ got add -R ~/ngircd.git/newcode%0a%3c @]%0a host:1636358870=198.251.82.194 author:1636358526=jrmu diff:1636358526:1636357524:=69,71c69,70%0a%3c For the rest of the guide, we will be working with%0a%3c ngircd's git repo, so let's clone that to our home directory:%0a%3c %0a---%0a> To clone a repo using [[OpenSSH/Connect|ssh]]:%0a> %0a73,74c72%0a%3c $ cd ~%0a%3c $ got clone git://github.com/ngircd/ngircd%0a---%0a> $ got clone git+ssh://example.com/repo.git%0a77,78c75,76%0a%3c To clone a repo using [[OpenSSH/Connect|ssh]]:%0a%3c %0a---%0a> For example, to clone OpenBSD's github repo:%0a> %0a80c78,79%0a%3c $ got clone git+ssh://example.com/repo.git%0a---%0a> $ cd /var/git/%0a> $ got clone ssh://git@github.com/openbsd/src.git%0a83,89d81%0a%3c For example, to clone OpenBSD's github repo:%0a%3c %0a%3c [@%0a%3c $ cd /var/git/%0a%3c $ got clone ssh://git@github.com/openbsd/src.git%0a%3c @]%0a%3c %0a91a84,89%0a> $ git clone https://github.com/openbsd/src.git%0a> %0a> !! Fetch new changes%0a> %0a> To fetch changes from a remote repo:%0a> %0a93c91%0a%3c $ git clone https://github.com/ngircd/ngircd%0a---%0a> $ got fetch%0a96,103d93%0a%3c !! Fetch new changes%0a%3c %0a%3c To fetch changes from a remote repo:%0a%3c %0a%3c [@%0a%3c $ got fetch%0a%3c @]%0a%3c %0a186,187c176,180%0a%3c For example:%0a%3c %0a---%0a> %0a> !! Update%0a> %0a> To update the work tree to the most recent commit:%0a> %0a189c182%0a%3c $ got diff ab0eb099e9c0ed60d25fb50dd78d2a638d3b49b8 f4ade537d550b872b7e86e6ffce940dfbad4c60c%0a---%0a> $ got update%0a192,201d184%0a%3c This will give you the diff of two files with those ID hashes.%0a%3c %0a%3c !! Update%0a%3c %0a%3c To update the work tree to the most recent commit:%0a%3c %0a%3c [@%0a%3c $ got update%0a%3c @]%0a%3c %0a217,222d199%0a%3c %0a%3c You can also specify the branch and commit:%0a%3c %0a%3c [@%0a%3c $ got update -b ssl-log-messages%0a%3c @]%0a host:1636358526=198.251.82.194 author:1636357524=jrmu diff:1636357524:1636357518:= host:1636357524=198.251.82.194 author:1636357518=jrmu diff:1636357518:1636356652:=103,107c103,113%0a%3c Replace @@/path/to/respository@@.%0a%3c %0a%3c You can check out code from a specific branch or%0a%3c commit with @@-b@@ and @@-c@@:%0a%3c %0a---%0a> @@got checkout@@ will show these status codes:%0a> %0a> || border=1 width=50%25 class="sortable simpletable"%0a> ||! Status || Meaning ||%0a> || A || new file added ||%0a> || E || file already exists ||%0a> %0a> !! Add file%0a> %0a> To add an unversioned file for the next commit:%0a> %0a109c115%0a%3c $ got checkout -b branch -c commit /path/to/repository%0a---%0a> $ got add filename%0a112,115c118,119%0a%3c got creates an ID SHA1 hash for every commit, so replace @@commit@@ with that hash.%0a%3c %0a%3c For example:%0a%3c %0a---%0a> Replace @@filename@@. If adding a directory:%0a> %0a117c121%0a%3c $ got checkout -b HEAD -c f4ade537d550b872b7e86e6ffce940dfbad4c60c ~/ngircd.git%0a---%0a> $ got add -R pathname%0a120,132c124,129%0a%3c This will check out the f4ade537d550b872b7e86e6ffce940dfbad4c60c commit from HEAD of the ngircd.git repo.%0a%3c %0a%3c @@got checkout@@ will show these status codes:%0a%3c %0a%3c || border=1 width=50%25 class="sortable simpletable"%0a%3c ||! Status || Meaning ||%0a%3c || A || new file added ||%0a%3c || E || file already exists ||%0a%3c %0a%3c !! Add file%0a%3c %0a%3c To add an unversioned file for the next commit:%0a%3c %0a---%0a> @@-R@@ allows recursion. Replace @@pathname@@.%0a> %0a> !! Remove file%0a> %0a> To remove a versioned file for deletion from the repo in the next commit:%0a> %0a134c131%0a%3c $ got add filename%0a---%0a> $ got remove filename%0a137,138c134,135%0a%3c Replace @@filename@@. If adding a directory:%0a%3c %0a---%0a> Replace @@filename@@. If removing a directory:%0a> %0a140c137%0a%3c $ got add -R pathname%0a---%0a> $ got remove -R pathname%0a145,148c142,145%0a%3c !! Remove file%0a%3c %0a%3c To remove a versioned file for deletion from the repo in the next commit:%0a%3c %0a---%0a> !! View changes%0a> %0a> To view changes in a work tree:%0a> %0a150c147%0a%3c $ got remove filename%0a---%0a> $ got diff | less%0a152,175d148%0a%3c %0a%3c Replace @@filename@@. If removing a directory:%0a%3c %0a%3c [@%0a%3c $ got remove -R pathname%0a%3c @]%0a%3c %0a%3c @@-R@@ allows recursion. Replace @@pathname@@.%0a%3c %0a%3c !! View changes%0a%3c %0a%3c To view changes in a work tree:%0a%3c %0a%3c [@%0a%3c $ got diff%0a%3c @]%0a%3c %0a%3c If you provide two objects, got will show the diff between just those two:%0a%3c %0a%3c [@%0a%3c $ got diff object1 object2%0a%3c @]%0a%3c %0a%3c Replace @@object1@@ and @@object@@ with the ID SHA1 hash.%0a host:1636357518=198.251.82.194 author:1636356652=jrmu diff:1636356652:1636354343:=84,85c84,85%0a%3c $ git clone https://github.com/openbsd/src.git%0a%3c %0a---%0a> $ git clone --bare https://github.com/openbsd/src.git%0a> %0a87,88d86%0a%3c %0a%3c To fetch changes from a remote repo:%0a host:1636356652=198.251.82.194 author:1636354343=jrmu diff:1636354343:1636311523:=25c25%0a%3c Replace @@username@@ and @@username@example.com@@. It's recommended to add this as part of your [[ksh/profile|~/.profile]]:%0a---%0a> It's recommended to add this as part of your [[ksh/profile|~/.profile]]:%0a host:1636354343=38.87.162.47 author:1636311523=jrmu diff:1636311523:1636311473:= host:1636311523=38.87.162.47 author:1636311473=jrmu diff:1636311473:1636310843:=108,109c108,109%0a%3c !! Add file%0a%3c %0a---%0a> !! Add File%0a> %0a120,135d119%0a%3c @]%0a%3c %0a%3c @@-R@@ allows recursion. Replace @@pathname@@.%0a%3c %0a%3c !! Remove file%0a%3c %0a%3c To remove a versioned file for deletion from the repo in the next commit:%0a%3c %0a%3c [@%0a%3c $ got remove filename%0a%3c @]%0a%3c %0a%3c Replace @@filename@@. If removing a directory:%0a%3c %0a%3c [@%0a%3c $ got remove -R pathname%0a host:1636311473=38.87.162.47 author:1636310843=jrmu diff:1636310843:1636310808:= host:1636310843=38.87.162.47 author:1636310808=jrmu diff:1636310808:1636310558:=108,111c108,111%0a%3c !! Add File%0a%3c %0a%3c To add an unversioned file for the next commit:%0a%3c %0a---%0a> !! View changes%0a> %0a> To view changes in a work tree:%0a> %0a113c113%0a%3c $ got add filename%0a---%0a> $ got diff | less%0a116,117c116,119%0a%3c Replace @@filename@@. If adding a directory:%0a%3c %0a---%0a> !! Update%0a> %0a> To update the work tree to the most recent commit:%0a> %0a119c121%0a%3c $ got add -R pathname%0a---%0a> $ got update%0a122,139d123%0a%3c @@-R@@ allows recursion. Replace @@pathname@@.%0a%3c %0a%3c !! View changes%0a%3c %0a%3c To view changes in a work tree:%0a%3c %0a%3c [@%0a%3c $ got diff | less%0a%3c @]%0a%3c %0a%3c !! Update%0a%3c %0a%3c To update the work tree to the most recent commit:%0a%3c %0a%3c [@%0a%3c $ got update%0a%3c @]%0a%3c %0a183,184d166%0a%3c %0a%3c To show commit history:%0a host:1636310808=38.87.162.47 author:1636310558=jrmu diff:1636310558:1636310282:=166,170d165%0a%3c !! Show History%0a%3c %0a%3c [@%0a%3c $ got log%0a%3c @]%0a host:1636310558=38.87.162.47 author:1636310282=jrmu diff:1636310282:1636310079:=157,164d156%0a%3c %0a%3c If changes are staged, the second column uses these codes:%0a%3c %0a%3c || border=1 width=100%25 class="sortable simpletable"%0a%3c ||! Status || Meaning ||%0a%3c || M || modification staged ||%0a%3c || A || addition staged ||%0a%3c || D || deletion staged ||%0a host:1636310282=38.87.162.47 author:1636310079=jrmu diff:1636310079:1636309758:=139,156d138%0a%3c %0a%3c !! View status%0a%3c %0a%3c To view the status of files in a work tree:%0a%3c %0a%3c [@%0a%3c $ got status%0a%3c @]%0a%3c %0a%3c || border=1 width=100%25 class="sortable simpletable"%0a%3c ||! Status || Meaning ||%0a%3c || M || modified ||%0a%3c || A || added in next commit ||%0a%3c || D || deleted in next commit ||%0a%3c || C || modified or added but contains merge conflicts ||%0a%3c || ! || versioned file expected but missing ||%0a%3c || ~ || versioned file blocked by non-regular file ||%0a%3c || ? || unversioned item, not tracked ||%0a host:1636310079=38.87.162.47 author:1636309758=jrmu diff:1636309758:1636309454:=137,139d136%0a%3c %0a%3c '''NOTE''': If there are staged changes, you must first commit or unstage them before using @@got update@@.%0a%3c %0a host:1636309758=38.87.162.47 author:1636309454=jrmu diff:1636309454:1636309430:=126c126%0a%3c || border=1 width=100%25 class="sortable simpletable"%0a---%0a> || border=1 width=100%25 class="sortable simpletable" ||%0a host:1636309454=38.87.162.47 author:1636309430=jrmu diff:1636309430:1636309382:=103,104c103,104%0a%3c || border=1 width=50%25 class="sortable simpletable"%0a%3c ||! Status || Meaning ||%0a---%0a> || border=1 width=100%25 class="sortable simpletable" ||%0a> ||! Status Code || Meaning ||%0a127c127%0a%3c ||! Status || Meaning ||%0a---%0a> ||! Status Code || Meaning ||%0a host:1636309430=38.87.162.47 author:1636309382=jrmu diff:1636309382:1636309309:=103,106c103,106%0a%3c || border=1 width=100%25 class="sortable simpletable" ||%0a%3c ||! Status Code || Meaning ||%0a%3c || A || new file added ||%0a%3c || E || file already exists ||%0a---%0a> [@%0a> A - new file added%0a> E - file already exists%0a> @]%0a host:1636309382=38.87.162.47 author:1636309309=jrmu diff:1636309309:1636308300:=115,136d114%0a%3c %0a%3c !! Update%0a%3c %0a%3c To update the work tree to the most recent commit:%0a%3c %0a%3c [@%0a%3c $ got update%0a%3c @]%0a%3c %0a%3c This will require manual merging of files if there are conflicts.%0a%3c %0a%3c || border=1 width=100%25 class="sortable simpletable" ||%0a%3c ||! Status Code || Meaning ||%0a%3c || U || file updated, no local changes ||%0a%3c || G || file updated, local changes merged ||%0a%3c || C || file updated, conflicts occurred during merge ||%0a%3c || D || file deleted ||%0a%3c || A || new file added ||%0a%3c || ~ || versioned file blocked by non-regular file ||%0a%3c || ! || missing versioned file restored ||%0a%3c || # || file not updated due to merge conflicts ||%0a%3c || ? || changes for an unversioned file not merged ||%0a host:1636309309=38.87.162.47 author:1636308300=jrmu diff:1636308300:1636308139:=101,103d100%0a%3c @@got checkout@@ will show these status codes:%0a%3c %0a%3c [@%0a106,107c103%0a%3c @]%0a%3c %0a---%0a> %0a112d107%0a%3c [@%0a114d108%0a%3c @]%0a host:1636308300=38.87.162.47 author:1636308139=jrmu diff:1636308139:1636307706:=104,108c104,121%0a%3c !! View changes%0a%3c %0a%3c To view changes in a work tree:%0a%3c %0a%3c $ got diff | less%0a---%0a> View local changes in a work tree directory:%0a> %0a> $ got diff | less%0a> %0a> In a work tree, display files in a potentially%0a> problematic state:%0a> %0a> $ got status -s 'C!~?'%0a> %0a> Interactively revert selected local changes in a work%0a> tree directory:%0a> %0a> $ got revert -p -R .%0a> %0a> In a work tree or a git repository directory, list all%0a> branch references:%0a> %0a> $ got branch -l%0a host:1636308139=38.87.162.47 author:1636307706=jrmu diff:1636307706:1636307524:=17,18c17,18%0a%3c !! Configuring Got%0a%3c %0a---%0a> !! Create a new repository%0a> %0a37,42c37,38%0a%3c By default, got uses the text editor [[ed/usage|ed]] if [[ksh/editor|$EDITOR]] or [[ksh/editor|$VISUAL]] are not set.%0a%3c %0a%3c !! Create a new repository%0a%3c %0a%3c To create an empty repository:%0a%3c %0a---%0a> Next, create an empty repository:%0a> %0a104,121c100%0a%3c View local changes in a work tree directory:%0a%3c %0a%3c $ got diff | less%0a%3c %0a%3c In a work tree, display files in a potentially%0a%3c problematic state:%0a%3c %0a%3c $ got status -s 'C!~?'%0a%3c %0a%3c Interactively revert selected local changes in a work%0a%3c tree directory:%0a%3c %0a%3c $ got revert -p -R .%0a%3c %0a%3c In a work tree or a git repository directory, list all%0a%3c branch references:%0a%3c %0a%3c $ got branch -l%0a---%0a> By default, got uses the text editor [[ed/usage|ed]] if [[ksh/editor|$EDITOR]] or [[ksh/editor|$VISUAL]] are not set.%0a host:1636307706=38.87.162.47 author:1636307524=jrmu diff:1636307524:1636305741:=31,32c31,32%0a%3c Let's also enable tab-completion of got commands:%0a%3c %0a---%0a> Next, create an empty repository:%0a> %0a34c34%0a%3c $ echo "set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)" >> ~/.profile%0a---%0a> $ got init /path/to/repository%0a37,42d36%0a%3c Next, create an empty repository:%0a%3c %0a%3c [@%0a%3c $ got init /path/to/repository%0a%3c @]%0a%3c %0a71,72c65,66%0a%3c For example, to clone OpenBSD's github repo:%0a%3c %0a---%0a> !! Fetch new changes%0a> %0a74,75c68%0a%3c $ cd /var/git/%0a%3c $ got clone ssh://git@github.com/openbsd/src.git%0a---%0a> $ got fetch%0a77,100d69%0a%3c %0a%3c HTTP URLs currently requires [[git/usage|git]]:%0a%3c %0a%3c $ git clone --bare https://github.com/openbsd/src.git%0a%3c %0a%3c !! Fetch new changes%0a%3c %0a%3c [@%0a%3c $ got fetch%0a%3c @]%0a%3c %0a%3c !! Checkout code%0a%3c %0a%3c Once you have a repository, you must first '''checkout'''%0a%3c the code into a '''work tree''' before you can use it:%0a%3c %0a%3c [@%0a%3c $ got checkout /path/to/repository%0a%3c @]%0a%3c %0a%3c A - new file added%0a%3c E - file already exists%0a%3c %0a%3c By default, got uses the text editor [[ed/usage|ed]] if [[ksh/editor|$EDITOR]] or [[ksh/editor|$VISUAL]] are not set.%0a host:1636307524=38.87.162.47 author:1636305741=jrmu diff:1636305741:1636305668:= host:1636305741=38.87.162.47 author:1636305668=jrmu diff:1636305668:1636305651:=69a70,80%0a> %0a> !!! Create a mirror%0a> %0a> To create a cloned mirror of a repository:%0a> %0a> [@%0a> $ got clone -m git://example.com/repo.git%0a> @]%0a> %0a> '''WARNING''': With a cloned repository, new fetches will%0a> cause any custom changes to get discarded.%0a host:1636305668=38.87.162.47 author:1636305651=jrmu diff:1636305651:1636305402:=79c79%0a%3c '''WARNING''': With a cloned repository, new fetches will%0a---%0a> '''WARNING''': With a cloned repository, fetches will%0a host:1636305651=38.87.162.47 author:1636305402=jrmu diff:1636305402:1636304457:=64,80d63%0a%3c %0a%3c !! Fetch new changes%0a%3c %0a%3c [@%0a%3c $ got fetch%0a%3c @]%0a%3c %0a%3c !!! Create a mirror%0a%3c %0a%3c To create a cloned mirror of a repository:%0a%3c %0a%3c [@%0a%3c $ got clone -m git://example.com/repo.git%0a%3c @]%0a%3c %0a%3c '''WARNING''': With a cloned repository, fetches will%0a%3c cause any custom changes to get discarded.%0a host:1636305402=38.87.162.47 author:1636304457=jrmu diff:1636304457:1636303309:=56c56%0a%3c $ got clone git://example.com/repo.git%0a---%0a> $ got clone git://example.com/%0a62c62%0a%3c $ got clone git+ssh://example.com/repo.git%0a---%0a> $ got clone git+ssh://example.com/%0a host:1636304457=38.87.162.47 author:1636303309=jrmu diff:1636303309:1636300531:=42c42%0a%3c $ got import -m "Import sources" -r /path/to/repository /path/to/code%0a---%0a> $ got import -m "Import message" -r /path/to/repository /path/to/code%0a45,47d44%0a%3c * @@-m@@ provides the log message for the import.%0a%3c * @@-r@@ provides the repository path.%0a%3c %0a51,63d47%0a%3c !! Clone a repository%0a%3c %0a%3c To clone a repo without encryption ('''WARNING''': insecure):%0a%3c %0a%3c [@%0a%3c $ got clone git://example.com/%0a%3c @]%0a%3c %0a%3c To clone a repo using [[OpenSSH/Connect|ssh]]:%0a%3c %0a%3c [@%0a%3c $ got clone git+ssh://example.com/%0a%3c @]%0a host:1636303309=38.87.162.47 author:1636300531=jrmu diff:1636300531:1636300229:=28c28%0a%3c $ echo 'export GOT_AUTHOR="username %3cusername@example.com>"' >> ~/.profile%0a---%0a> $ echo 'export GOT_AUTHOR="username%3cusername@example.com>"' >> ~/.profile%0a host:1636300531=38.87.162.47 author:1636300229=jrmu diff:1636300229:1636299491:=16a17,20%0a> !! Documentation%0a> %0a> [[http://gameoftrees.org/got.1.html|got]]%0a> %0a19,20c23,24%0a%3c First, we need to tell [[http://gameoftrees.org/got.1.html|got]] about the author of the repo:%0a%3c %0a---%0a> First, we create an empty repository:%0a> %0a22c26%0a%3c $ export GOT_AUTHOR="username %3cusername@example.com>"%0a---%0a> $ got init /path/to/repository%0a25,26c29,32%0a%3c It's recommended to add this as part of your [[ksh/profile|~/.profile]]:%0a%3c %0a---%0a> Replace @@/path/to/repository@@.%0a> %0a> Afterwards, we need to import the code for the repository:%0a> %0a28c34%0a%3c $ echo 'export GOT_AUTHOR="username%3cusername@example.com>"' >> ~/.profile%0a---%0a> $ got import -m "Import message" -r /path/to/repository /path/to/code%0a31,44d36%0a%3c Next, create an empty repository:%0a%3c %0a%3c [@%0a%3c $ got init /path/to/repository%0a%3c @]%0a%3c %0a%3c Replace @@/path/to/repository@@.%0a%3c %0a%3c Afterwards, we need to import the code for the repository:%0a%3c %0a%3c [@%0a%3c $ got import -m "Import message" -r /path/to/repository /path/to/code%0a%3c @]%0a%3c %0a47c39%0a%3c %0a---%0a> [[http://gameoftrees.org/got.conf.5.html|got.conf]]%0a host:1636300229=38.87.162.47 author:1636299491=jrmu diff:1636299491:1636299388:=38,39d37%0a%3c %0a%3c [[http://gameoftrees.org/got.conf.5.html|got.conf]]%0a host:1636299491=38.87.162.47 author:1636299388=jrmu diff:1636299388:1636298711:=20,37d19%0a%3c %0a%3c !! Create a new repository%0a%3c %0a%3c First, we create an empty repository:%0a%3c %0a%3c [@%0a%3c $ got init /path/to/repository%0a%3c @]%0a%3c %0a%3c Replace @@/path/to/repository@@.%0a%3c %0a%3c Afterwards, we need to import the code for the repository:%0a%3c %0a%3c [@%0a%3c $ got import -m "Import message" -r /path/to/repository /path/to/code%0a%3c @]%0a%3c %0a%3c Replace @@/path/to/repository@@ and @@/path/to/code@@.%0a host:1636299388=38.87.162.47 author:1636298711=jrmu diff:1636298711:1636298582:=17,19d16%0a%3c !! Documentation%0a%3c %0a%3c [[http://gameoftrees.org/got.1.html|got]]%0a host:1636298711=38.87.162.47 author:1636298582=jrmu diff:1636298582:1636298447:=3c3%0a%3c [[http://gameoftrees.org|Game of Trees (Got)]] is a simple, easy to use%0a---%0a> Game of Trees (Got) is a simple, easy to use%0a host:1636298582=38.87.162.47 author:1636298447=jrmu diff:1636298447:1636298220:=1,12d0%0a%3c (:title Game of Trees:)%0a%3c %0a%3c Game of Trees (Got) is a simple, easy to use%0a%3c version control system that aims to be compatible%0a%3c with git repos.%0a%3c %0a%3c It's still under development, but can be used today%0a%3c as a substitute for git. It is freely reusable under%0a%3c a BSD license.%0a%3c %0a%3c !! Install%0a%3c %0a16d3%0a%3c %0a host:1636298447=38.87.162.47 author:1636298220=jrmu diff:1636298220:1636298220:=1,3d0%0a%3c [@%0a%3c $ doas pkg_add got%0a%3c @]%0a host:1636298220=38.87.162.47