# portsnap and git getting ports



## bagas (Nov 6, 2021)

Hello.
Is it necessary to install git to install ports now?
Is it enough to fetch and update ports - portsnap fetch extract update (portsnap fetch update)?
git, can I not install it?


----------



## eternal_noob (Nov 6, 2021)

Yes, FreeBSD switched to Git some time ago.

See https://forums.freebsd.org/threads/guide-using-git-to-manage-ports-source-and-documentation.79721/ for a tutorial.

If you don't want the full Git experience, you can work with devel/git-lite.
Edit: Seems like `git-lite` is gone.


----------



## zirias@ (Nov 6, 2021)

bagas said:


> Is it necessary to install git to install ports now?


No.


bagas said:


> Is it enough to fetch and update ports - portsnap fetch extract update (portsnap fetch update)?


Yes. Actually, there were plans to deprecate portsnap. It's extra infrastructure to maintain for no gain, and it only supports the "main" branch ("latest" ports). But _at least_ for any FreeBSD 13 version, it will stay supported.


----------



## Tieks (Nov 6, 2021)

bagas said:


> portsnap fetch extract update


Portsnap still works, but will be phased out some time in a future version. Git will replace it, see the link that eternal_noob gave you. Another alternative (that I don't know) is net/gitup.


----------



## zirias@ (Nov 6, 2021)

eternal_noob said:


> Edit: Seems like `git-lite` is gone.


Not really, devel/git was converted to flavors, so there's a `lite` flavor now (and also a `tiny` flavor, which is actually enough to work with FreeBSD ports).


----------



## bagas (Nov 6, 2021)

I understand, I'd better install git then.


----------



## fernandel (Nov 6, 2021)

bagas said:


> I understand, I'd better install git then.


I am using net/gitup and for me works. It is like portsnap just `gitup ports` and it is.


----------



## msplsh (Nov 12, 2021)

I installed

`pkg install git-lite`

And then

`git ls-remote https://git.freebsd.org/ports.git | grep refs/heads`

To find the quarterly branch I want.  Then deleted the entirety of /usr/ports and ran

`git clone -o ports -b 2021Q4 https://git.freebsd.org/ports.git /usr/ports`

I expect I can now 

`cd /usr/ports;git pull --rebase`

When I want to update it, per instructions in https://docs.freebsd.org/en/books/handbook/mirrors/#git

and when a new quarterly comes out I _assume_ can do

`cd /usr/ports;git checkout -b 2022Q1`

To align ports with pkg using quarterly


----------

