diff --git a/extensions/got.ksh b/extensions/got.ksh index da68aed..17bbd5d 100755 --- a/extensions/got.ksh +++ b/extensions/got.ksh @@ -16,6 +16,14 @@ function got-push { (cd "$r" && git push "$@") } +function got-sync { + local _remote + _remote=$1 + [ -z $_remote ] && _remote="origin" + got fetch "$_remote" && got update -b "$_remote/master" && \ + got rebase master +} + function __got_ps1 { local _format _branch _status _format=$1 diff --git a/extensions/got.org b/extensions/got.org index 32920dc..c276e0d 100644 --- a/extensions/got.org +++ b/extensions/got.org @@ -2,7 +2,9 @@ This extension adds helper functions to the [[https://gameoftrees.org/][got]] tool. -| Function | Description | -|------------+-------------------------------------------------------------------------| -| ~got-push~ | Pushes (~git push~) from the bare repository found in ~.got/repository~ | +| Function | Description | +|-------------+-------------------------------------------------------------------------| +| ~got-push~ | Pushes (~git push~) from the bare repository found in ~.got/repository~ | +| ~got-sync~ | Rebase ~master~ on top of ~[remote]/master~. Defaults to ~origin~. | +| ~__got_ps1~ | Current got branch. Intended to be used in ~$PS1~. |