Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Dec 2020 13:15:28 +0100
From:      Stefan Sperling <stsp@stsp.name>
To:        Christian Weisgerber <naddy@mips.inka.de>
Cc:        freebsd-git@freebsd.org
Subject:   Re: Following src with got (sic!)
Message-ID:  <20201224121528.GD92065@ted.stsp.name>
In-Reply-To: <X%2BOaiLYZxvtBgWq2@lorvorc.mips.inka.de>
References:  <X%2BOaiLYZxvtBgWq2@lorvorc.mips.inka.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Dec 23, 2020 at 08:29:12PM +0100, Christian Weisgerber wrote:
> Got is a nascent version control system that uses the git repository
> format and thus has some degree of interoperability with git.
> http://gameoftrees.org/
> People who don't need the full git experience may be able to use
> got to check out the FreeBSD src repository.  There has been some
> talk of importing got into base as a successor to svnlite.  Meanwhile,
> there's a devel/got port.

Thanks for writing this up :)

One small correction below:

> If you feel overwhelmed by the flood of magic command lines and
> configuration file sections that are being posted for git...
> Well, here are some less imposing magic command lines that will
> also be easier to make sense of from the got(1) man page:
> 
> Clone the repository:
> $ cd /somewhere
> $ got clone -a ssh://anongit@git.freebsd.org/src.git
> 
> Check out stable/12:
> $ cd /usr
> $ got checkout -b stable/12 /somewhere/src.git
> 
> I verified with "diff -uNr -x .got -x .svn -I '\$FreeBSD.*\$'" that
> this is indeed identical to a svn checkout.
> 
> Update your source:
> $ cd /usr/src
> $ got fetch
> $ got update -b origin/stable/12
> $ got rebase stable/12
> 
> This is the standard configuration which allows you to have changes
> on a local branch distinct from the upstream origin/* one.
> 
> If you are sure you don't need this, you can simplify things by
> cloning a mirror of the original repository:
> $ got clone -a -m ssh://anongit@git.freebsd.org/src.git
> ... and updating your checked out source will simply be:
> $ cd /usr/src
> $ got fetch
> $ got update

The above commands will not result in updated files even if new changes
appeared in stable/12 on the server.

By default 'got fetch' will only fetch the branch corresponding to the HEAD
reference of the repository, which usually points at the "main" branch.
Instead, this fetches all branches:

  $ got fetch -a

To fetch just new commits on the stable/12 branch, either use:

  $ got fetch -b stable/12

or add the 'stable/12' branch to the repository's got.conf(5) file:

remote "origin" {
	server anongit@git.freebsd.org
	protocol ssh
	repository "/src.git"
	branch "stable/12"
}

Now a simple 'got fetch' implies '-b stable/12'.

A collection of branches to fetch by default can be defined like this:

remote "origin" {
	server anongit@git.freebsd.org
	protocol ssh
	repository "/src.git"
	branch "main"
	branch "stable/12"
	branch "stable/11"
	branch "stable/10"
}

Cheers,
Stefan

> You may also want to give the tog(1) repository browser a spin.
> Very handy to figure out who, say, probably broke wcwidth()...
> 
> Check it out! (pun intended)
> 
> - - - - -
> 
> At this time, got does not yet support cloning/fetching over https,
> pushing to a remote repository, or garbage collection.  Git can be
> used to supply missing functionality for the time being.
> 
> -- 
> Christian "naddy" Weisgerber                          naddy@mips.inka.de
> _______________________________________________
> freebsd-git@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-git
> To unsubscribe, send any mail to "freebsd-git-unsubscribe@freebsd.org"
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20201224121528.GD92065>