# So... how do now update my local ports tree?



## firetree (Apr 7, 2021)

I run a home/office server, mainly for my own personal/business use, I need to do little server admin but do regularly update. 
portsnap is obviously not playing ball at the moment; I've looked through the "Ports transitioned to git." thread a few times (also performed many google searches like: "how to update freebsd via git") and installed gitup but 

```
gitup ports
# Host: github.com
# Port: 443
# Repository: /freebsd/freebsd-ports.git
# Target: /usr/ports
gitup: get_commit_details: refs/heads/master doesn't exist in /freebsd/freebsd-ports.git: Invalid argument
```
doesn't help.
Apologies if I'm missing the bleedin' obvious but I *just have no idea* what to do to update my ports now; the Handbook hasn't been updated and all the git transition talk is a bit "wood for the trees" territory for me; I've never used git and am rather lost >_<   This is the sort of thing that I should breeze through but... aaaarg!
Whaddoido? I appreciate that patience might be the immediate answer and that all will be documented in time.
Many thanks.


----------



## zirias@ (Apr 7, 2021)

You have an old gitup config.








						Solved - starting port updates
					

Hello. The last time the ports were updated a week ago. Now I start updating ports and receive messages that the ports have not changed, there are no updates.  # portsnap fetch update Looking up portsnap.FreeBSD.org mirrors... none found. Fetching snapshot tag from portsnap.FreeBSD.org... done...




					forums.freebsd.org


----------



## firetree (Apr 7, 2021)

Aha! A thousand thanks.


----------



## Minbari (Apr 16, 2021)

I have a similar error but with quarterly and I've updated that config file.

```
gitup quarterly
# Host: git.freebsd.org
# Port: 443
# Repository: /ports.git
# Target: /usr/ports
gitup: get_commit_details: refs/heads/branches/2021Q2 doesn't exist in /ports.git: Invalid argument
```

gitup.conf:

```
# $FreeBSD$
#
# Default configuration options for gitup.conf.
{
    "defaults" : {
        "host"           : "git.freebsd.org",
        "port"           : 443,
#        "proxy_host"     : "",
#        "proxy_port"     : 0,
#        "proxy_username" : "",
#        "proxy_password" : "",
        "verbosity"      : 1,
        "work_directory" : "/var/db/gitup",
    },

    "ports" : {
        "repository_path"  : "/ports.git",
        "branch"           : "main",
        "target_directory" : "/usr/ports",
        "ignores"          : [
            "distfiles",
            "packages",
            "INDEX-11",
            "INDEX-12",
            "INDEX-13",
            "INDEX-14",
        ],
    },

    "quarterly" : {
        "repository_path"  : "/ports.git",
        "branch"           : "quarterly",
        "target_directory" : "/usr/ports",
        "ignores"          : [
            "distfiles",
            "packages",
            "INDEX-11",
            "INDEX-12",
            "INDEX-13",
            "INDEX-14",
        ]
    },

    "release" : {
        "repository_path"  : "/src.git",
        "branch"           : "releng/12.2",
        "target_directory" : "/usr/src",
        "ignores"          : [
            "sys/amd64/conf",
            "sys/arm64/conf",
            "sys/i386/conf",
            "sys/pc98/conf",
            "sys/powerpc/conf",
            "sys/riscv/conf",
            "sys/sparc64/conf",
        ]
    },

}
```
Things were so simple with cvn/svn...


----------



## bsduck (Apr 16, 2021)

I also tried using `gitup quarterly` with the same config, and it did not work either. Obviously there is no branch named "quarterly" on git.freebsd.org, so it cannot find anything. It would probably work with setting `"branch" : "2021Q2"` but then I don't see any advantage in using it instead of plain `git` if you have to manually switch from a quarterly branch to the next one anyway.


----------



## SirDice (Apr 16, 2021)

bsduck said:


> Obviously there is no branch named "quarterly" on git.freebsd.org, so it cannot find anything.



The code calculates the correct branch when it's been set to 'quarterly'. 









						gitup/gitup.c at d937f6635fe12520356b5bf88f96eed61052c03a · johnmehr/gitup
					

A minimalist, dependency-free FreeBSD program to clone/pull Git repositories. - gitup/gitup.c at d937f6635fe12520356b5bf88f96eed61052c03a · johnmehr/gitup




					github.com
				




The error seems to indicate it doesn't know that a new branch exists. jmehr is this a bug?


----------



## bsduck (Apr 16, 2021)

Nice. When it works I may adopt it then.

As of now I noticed there is an open bug about this: https://github.com/johnmehr/gitup/issues/62

Maybe it works with gitup built from the latest sources but I didn't try.


----------



## jmehr (Apr 16, 2021)

SirDice said:


> The code calculates the correct branch when it's been set to 'quarterly'.
> 
> 
> 
> ...



I pushed out a fix for this issue a few days ago.  As soon as the code I had to add to switch from using the installed /usr/include/base64.h to OpenSSL's base64 encoding functions is validated, the proxy support feature should be fully functional and I'll be able to release 0.91 (hopefully tomorrow).


----------



## drhowarddrfine (Apr 17, 2021)

Why don't people use the git method in the Handbook? I install git-lite not git. Works perfectly and nothing to learn except the command.


----------



## athan (Apr 17, 2021)

drhowarddrfine said:


> Why don't people use the git method in the Handbook? I install git-lite not git. Works perfectly and nothing to learn except the command.


I use the ports tree to build applications as lightweight as possible with the least possible dependencies. So how can I want git (or even git-lite) installed when it has more dependencies than all the other applications together?

Gitup as a standalone executable could be an ideal alternative to portsnap, especially if FreeBSD devs decide to include it in the base as they did in the past with svnlite and portsnap.

Great job jmehr!


----------



## ShelLuser (Apr 17, 2021)

I have to agree with drhowarddrfine up there, I also fail to understand all the fuzz about making something so trivial a lot harder   If you want the ports collection then all it takes is one command: `# git clone https://git.freebsd.org/ports.git /usr/ports` and from there all you need is to run `git pull` from within /usr/ports to keep things up to date.

Do you want to keep track of a quarterly release? Just take your pick: `git branch -r` and switch if needed. For example, after the above commands I could use `git switch origin/2021q2` to solely use the state of the second quarterly release.

This setup also gives you way more flexibility.


----------



## drhowarddrfine (Apr 17, 2021)

athan said:


> So how can I want git (or even git-lite) installed when it has more dependencies than all the other applications together?


Not my point. My point is that people now want to install gitup which (I have not looked) I assume installs git. So an application for an application when one can just install git-lite and accomplish the same thing on their own. Or do I not understand exactly how gitup makes life easier than `git clone https://git.freebsd.org/ports.git /usr/ports`?


----------



## zirias@ (Apr 17, 2021)

drhowarddrfine said:


> My point is that people now want to install gitup which (I have not looked) I assume installs git.


It doesn't. The whole point of gitup is to be minimal and dependency-free.


----------



## drhowarddrfine (Apr 17, 2021)

Zirias Ok. Does gitup install git?


----------



## zirias@ (Apr 17, 2021)

I don't understand why I have to repeat this? No.


----------



## drhowarddrfine (Apr 17, 2021)

So gitup is not git but does the same thing as git? Now I'm really confused.

And if gitup is not git, then you lose the value of having git should you need it?


----------



## zirias@ (Apr 17, 2021)

Again, the whole point of gitup is to be minimal and dependency-free. And no, it doesn't do the same as git. There's a whole lot of things you can't do with gitup. It just uses the git protocol to update a local file tree from a remote git repository and that's it. More or less a replacement for portsnap using the repository as its source (just as svnup did with subversion).


----------



## SirDice (Apr 17, 2021)

drhowarddrfine said:


> So gitup is not git but does the same thing as git? Now I'm really confused.


Do you remember net/cvsup-without-gui or svnup(1)? Same idea. It's just a really toned down client, only capable of getting the latest versions from CVS, SVN and now with net/gitup git. Intended for people that don't need (or want) a full fledged VCS but want to grab the latest ports or source trees.


----------

