OPNsense Forum

English Forums => Documentation and Translation => Topic started by: opnsenseuser on July 27, 2025, 11:54:32 AM

Title: git remote add upstream
Post by: opnsenseuser on July 27, 2025, 11:54:32 AM
if i try to add the git upstream to f.e. "core", like git remote add upstream https://github.com/opnsense/core.git i get the error fatal: not a git repository (or any of the parent directories): .git

does anything change?

regards rené
Title: Re: git remote add upstream
Post by: patient0 on July 27, 2025, 12:46:14 PM
Quote from: opnsenseuser on July 27, 2025, 11:54:32 AMerror fatal: not a git repository (or any of the parent directories): .git
That means that the directory you are in - locally - is not a git directory.
Title: Re: git remote add upstream
Post by: opnsenseuser on July 27, 2025, 01:19:45 PM
how can i fix this. this works for me since 10 years
Title: Re: git remote add upstream
Post by: patient0 on July 27, 2025, 01:24:09 PM
Quote from: opnsenseuser on July 27, 2025, 01:19:45 PMhow can i fix this. this works for me since 10 years
Make sure the directory you are in is a git repo. What is the path you are in and what is the output of 'git status'?

Something changed locally and only you can know what that is. Are the permission correct? What is the OS the directory is on?
Title: Re: git remote add upstream
Post by: opnsenseuser on July 27, 2025, 01:31:36 PM
ok, thx for your support. now it works. i reinitialized the repo using
Quotegit init
Title: Re: git remote add upstream
Post by: opnsenseuser on July 27, 2025, 02:31:38 PM
no, it doesn´t work. i did full access on both folder "core" and "plugins" on my local drive. but when i try to clone. it says:" No such file or directory"

what can i do?
Title: Re: git remote add upstream
Post by: patient0 on July 27, 2025, 04:10:27 PM
What are you trying to do? Do you have your own 'core' and 'plugin' repos? If you want to checkout then 'git clone <repo>' is what you want to use.

But if you use 'git' for 10 year you surely know about a git repo structure, like the '.git' folder within a repo. But you haven't answered which OS you are using.
Title: Re: git remote add upstream
Post by: opnsenseuser on July 28, 2025, 05:41:34 PM
This message i get in "github for desktop" using windows as my operating system.

QuoteD:/opnsense-github/core/.git: No such file or directory
Cloning into 'D:\opnsense-github\core'...

Would you like to retry cloning ?

i reinstalled "github for desktop" and set the permissions (full access) for the whole folder "D:\opnsense-github" to "everyone". but even then i get this error message. i really don´t know why.
what can i do?

syncing using my batch file works without any problems.

Quoted:
cd opnsense-github\core
git pull upstream master
cd..
cd plugins
git pull upstream master
pause



Title: Re: git remote add upstream
Post by: patient0 on July 28, 2025, 07:53:28 PM
I don't use Windows, someone else may chime in who does use git on Windows.
Title: Re: git remote add upstream
Post by: opnsenseuser on July 28, 2025, 09:10:50 PM
ok, i fixed it. it was a windows problem. suddenly the windows Folder protection was active on drive d:\ .Maybe a windows update caused this problem.

thx for your support