Re: git pull not replicating?

From: Michael Gmelin <grembo_at_freebsd.org>
Date: Sat, 18 Jun 2022 16:30:17 UTC

> On 18. Jun 2022, at 15:58, Andy Farkas <andyf@andyit.com.au> wrote:
> 
> 
> If I do a 'git pull' in /usr/ports usually it updates a few files
> and I think 'good, my ports tree is in sync with upstream'. And if
> I do it again shortly afterwards, I get:
> 
> root:/usr/ports # git pull
> Already up to date.
> root:/usr/ports #
> 
> Which is also good.
> 
> But if I do this:
> 
> root:/usr/ports # mv ftp /root/
> root:/usr/ports # git pull
> Already up to date.
> root:/usr/ports #
> 
> ..which is obviously false.

Git fetch/pull is about what was pulled into .git (its index, which is all objects, branches and what not). If you want to get the state of your working directory, use `git status`.

See https://git-scm.com/docs/git-pull

If you want to clean your local workdir, use:

    git clean -fd
    git checkout .

from within your git root directory.

-m

> 
> Now my belief that I am in sync with upstream is shattered.
> 
> Is there a git incantation that will make sure my tree is fully
> in sync with upstream?
> 
> Thanks,
> 
> -andyf
> 
> ps.
> 
> root:/usr/ports # cat .git/config
> [core]
>         repositoryformatversion = 0
>         filemode = true
>         bare = false
>         logallrefupdates = true
> [remote "origin"]
>         url = https://git.freebsd.org/ports.git
>         fetch = +refs/heads/main:refs/remotes/origin/main
> [branch "main"]
>         remote = origin
>         merge = refs/heads/main
> 
> 
>