Re: [fpc-other] (Probably trivial) git help, please

2025-10-26 Thread Martin Frb via fpc-other

On 26/10/2025 16:20, Brian via fpc-other wrote:


You would be correct the first time, but then I tried using p7zip to 
pack up the entire directory and copied that across, then unpacked it, 
and it still had problems. I could have tried moving rather than 
copying, but then that leaves me with a problem that I have to do 
another copy as I'm using the old drive as my backup device. I think 
I'm about to start writing my own very specific backup utility!


Well, if you want one of the drives to be backup of the other, then you 
need to keep syncing them.


So just "git clone" between the drives.

On the new empty folder
  git clone --origin=backup  /mount/foo/existing_repo ./new_repo_folder

then
  cd new_repo_folder
  git remote add origin https://git_remote_server_url


You can also create a new empty repo, add that to your backup, and push 
everything.
That means that then your backup will be pulling, and your new repo will 
not show the remote branches for the backup.
Having the backup pull also avoids "force pushes" if your working repo 
gets branches rebased (should you ever do that).


___
fpc-other maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other


Re: [fpc-other] (Probably trivial) git help, please

2025-10-26 Thread Brian via fpc-other

On 10/26/25 10:30, wkitty42--- via fpc-other wrote:

On 10/24/25 4:49 AM, Brian via fpc-other wrote:

On 10/24/25 04:26, Johannes Truschnigg via fpc-other wrote:

Hi Brian,

sounds odd, since git doesn't care about filesystem metadata of the 
files it
tracks - it just cares about their content. So if you did a 1:1 
copy of the
repository directory onto another drive, unless something mangled 
the data
during that copy, not a thing should have changed from git's 
perspective...


Yes, absolutely - just installed the new NAS, put the old drive on a 
temporary mount point, and did a simple copy.


this sounds like you missed the hidden-by-default .git directory if 
you used the normal copy command... if that directory was copied from 
the original then please ignore me... i'm also still pre- 1st c0ffee 
of the day...




You would be correct the first time, but then I tried using p7zip to 
pack up the entire directory and copied that across, then unpacked it, 
and it still had problems. I could have tried moving rather than 
copying, but then that leaves me with a problem that I have to do 
another copy as I'm using the old drive as my backup device. I think 
I'm about to start writing my own very specific backup utility!



Brian.


___
fpc-other maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other


Re: [fpc-other] (Probably trivial) git help, please

2025-10-26 Thread wkitty42--- via fpc-other

On 10/24/25 4:49 AM, Brian via fpc-other wrote:

On 10/24/25 04:26, Johannes Truschnigg via fpc-other wrote:

Hi Brian,

sounds odd, since git doesn't care about filesystem metadata of the files it
tracks - it just cares about their content. So if you did a 1:1 copy of the
repository directory onto another drive, unless something mangled the data
during that copy, not a thing should have changed from git's perspective...


Yes, absolutely - just installed the new NAS, put the old drive on a temporary 
mount point, and did a simple copy.


this sounds like you missed the hidden-by-default .git directory if you used the 
normal copy command... if that directory was copied from the original then 
please ignore me... i'm also still pre- 1st c0ffee of the day...


--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list where it belongs!*
___
fpc-other maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other


Re: [fpc-other] (Probably trivial) git help, please

2025-10-25 Thread Christo Crause via fpc-other
On Fri, Oct 24, 2025 at 10:19 AM brian via fpc-other <
[email protected]> wrote:

>
> I've just replaced one drive on my PC with a NAS device. Now when I
> try to do a git pull, git asks me to stash or merge a whole bunch of
> local files which it alleges I have modified. Of course, I have made
> no modifications at all.
>

 It could be due to change in file mode when copying the git folder across
different file systems.  I had a similar issue when copying a git folder
from ext4 to FAT32 and back to ext4. For more information read up on the
core.filemode configuration option (https://git-scm.com/docs/git-config).
IIRC I fixed my issue by stashing the changes (git stash), then pulling
main, then delete this stash since it is bogus (git stash drop).
___
fpc-other maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other


Re: [fpc-other] (Probably trivial) git help, please

2025-10-25 Thread Brian via fpc-other

On 10/24/25 04:26, Johannes Truschnigg via fpc-other wrote:

Hi Brian,

sounds odd, since git doesn't care about filesystem metadata of the files it
tracks - it just cares about their content. So if you did a 1:1 copy of the
repository directory onto another drive, unless something mangled the data
during that copy, not a thing should have changed from git's perspective...


Yes, absolutely - just installed the new NAS, put the old drive on a 
temporary mount point, and did a simple copy.




If you are 100% certain you don't have any local modifications to files
tracked by git that warrant preserving (you can check that with `git diff`,
which shows you the changes made from the presently commited state), the
easiest way out probably is to `git reset --hard`, which will make git restore
all files it tracks to exactly the content as of the commit you are pointed
at.



Thanks, I will give it a try.



Of course, If that doesn't work or give you any other kind of trouble, you can
always just clone the source repository into another brand new location, and
resume your activities from there.



I was just being lazy, I have a script that updates the various repos 
and it's much easier to edit a copy of that than to find all the URLs 
again. :)


Thanks for the help (also Tomas)

Brian.

___
fpc-other maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other


Re: [fpc-other] (Probably trivial) git help, please

2025-10-24 Thread Johannes Truschnigg via fpc-other
Hi Brian,

sounds odd, since git doesn't care about filesystem metadata of the files it
tracks - it just cares about their content. So if you did a 1:1 copy of the
repository directory onto another drive, unless something mangled the data
during that copy, not a thing should have changed from git's perspective...

If you are 100% certain you don't have any local modifications to files
tracked by git that warrant preserving (you can check that with `git diff`,
which shows you the changes made from the presently commited state), the
easiest way out probably is to `git reset --hard`, which will make git restore
all files it tracks to exactly the content as of the commit you are pointed
at.

Of course, If that doesn't work or give you any other kind of trouble, you can
always just clone the source repository into another brand new location, and
resume your activities from there.

Hth! :)

-- 
with best regards:
- Johannes Truschnigg ( [email protected] )

www:   https://johannes.truschnigg.info/


signature.asc
Description: PGP signature
___
fpc-other maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other


Re: [fpc-other] (Probably trivial) git help, please

2025-10-24 Thread Tomas Hajny via fpc-other

On 2025-10-23 15:30, brian via fpc-other wrote:


Hi Brian,


I've been downloading fpc from Git and building it myself.

I've just replaced one drive on my PC with a NAS device. Now when I try 
to do a git pull, git asks me to stash or merge a whole bunch of local 
files which it alleges I have modified. Of course, I have made no 
modifications at all.


I've read the Git help, but I don't really understand most of it. :(

How do I fix this mess? :(


First of all - how did you perform that "replacement"? Do you mean that 
you copied the content of the original drive (including the git checkout 
of FPC sources) to the NAS device? If so and assuming that you have no 
own changes at all in that checkout, the easiest solution for you (since 
you probably don't want to mess with various git commands in order to 
fix the existing files) is probably removing the local checkout and 
performing git clone again.


Hope this helps

Tomas
___
fpc-other maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other