Git lazarus / 21-General ---------------------------------------------------------------------- BSaidus · 2024-01-28 10:30 Hello. Excuse me for this question ( not really related to Lazarus/FPC but it is close ) but I did not find where to get responses. So.   Suppose I have a remote repository ( say, in github or gitlab ) & I want to clone under windows using TortoiseGit in 'bare' mode. Ex:     Clone : https://github.com/synopse/mORMot2.git                     <= REPO-A      To      : D:\Source_Git\mORMot2                    <= bare repos    <= REPO-B              When this is done, I create a new folder & clone the previous repository. Ex:     Clone : D:\Source_Git\mORMot2                    <= bare repos <= REPO-B     To      : C:\Dev\mORMot2                                                  <= REPO-C All theses operations are done very well. But the problem I encounter is when trying to Update the REPO-B, from the  REPO-A. It do not fetch the remote modification event if there is modifications. Even the log shows the last modification time is the one I fetch it for the first time. Thank you. ---------------------------------------------------------------------- Martin_fr · 2024-01-28 11:18 Seems a shortcoming of tortoise. Neither of the required options seems to be available. What you preferably want to do, is clone as --mirror Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i git clone --mirror https://github.com/synopse/mORMot2.git  D:\Source_Git\mORMot2 With what you currently have, you need to do Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i git fetch  origin *:* But tortoise does not give you either. Their is a "git config ..." that you may be able to do on your current bare clone. And that should make git fetch work. But I need to look that up... Anyway, what do you try to achieve? Using the bare/mirror in-between will mean a lot of extra steps for every pull/push. If you want to have a local "host", so you can connect several local clients (like clones in virtual machines) with the ability to exchange your local branches between them, then you don't need that. Just connect your other (VM) clients to the normal clone (have one direct clone, with checkout). You can connect the VM, either via shared folder, or via "git daemon". Only one point. If you commit (and then push) from any of those other clients, use a branch that is NOT checked out at the "host".  And then you can push those branches to the host, even if the host has checked out files. If you need multiple checkouts on the same PC, look at "git worktree". ---------------------------------------------------------------------- BSaidus · 2024-01-28 14:47 Ah, thanks, @Martin_fr.  If I understand, TortoiseGit do not give all options suitable for this.  & If I understand your recommandation :        Step1:       Clone : https://github.com/synopse/mORMot2.git                                 <= REPO-A       To      : D:\Source_Git\mORMot2                    <= bare repos or mirror    <= REPO-B   Step2:       Clone : D:\Source_Git\mORMot2                    <= bare repos <= REPO-B       To      : C:\Dev\mORMot2                                                  <= REPO-C    Step3: QuoteOnly one point. If you commit (and then push) from any of those other clients, use a branch that is NOT checked out at the "host".  And then you can push those branches to the host, even if the host has checked out files.      Create a working branch & commit modification to this branche. But what about merging modifs to the remote repo  'REPO-A'. Thanks ---------------------------------------------------------------------- TRon · 2024-01-28 15:05 Hi BSaidus: Frankly speaking I am a bit confused by what you are trying to achieve. At least it seems to be a (git) workflow which I am not familiar with. Could you elaborate or are you just dipping your toes into git perhaps ? Usually you clone a repo, create your own branch in which you make your modifications, then test your branch' modifications and when good enough merge them back into the main branch (locally). The latter is not fairly common but is used when you want your modification to be your own. Usually you create either a patch file or do a merge request for your modifications to the original repo. But the above is just /a/ workflow (out of many). edit: for working with branches f.e. see branching workflows and in case looking for a more practical approach see f.e. How to Use Git and Git Workflows – a Practical Guide (it is at least a very good explanation of some of the git basics in case you are not familiar). I'm fairly positive that turtoise has similar documentation. ---------------------------------------------------------------------- Martin_fr · 2024-01-28 17:00 Not sure of exactly your last reply.... Couldn't figure: - You want to have further clones in your local networks (e.g. on virtual machines) and sync them without the need of github/lab? - You want to have several checkouts on the same PC (e.g. fixes and main branch in 2 different folders) - Something else? In any case, you should not need a bare repo, neither a mirror repo. Make a normal clone, with checkout and all. If you need a 2nd checkout on the same machine https://git-scm.com/docs/git-worktree Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i cd current_git_dirgit worktree add --detach  ../new_git_dir You can then go to new_git_dir and check out any branch. Only restriction, if you check out the same branch as in the first repo, you must give your local branch a different name. If you first repo is checked out to "main" at "origin/main" then in your 2nd repo do Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   git switch -c main2 origin/main You can create any amount of clones from your first repo (even though it has a work dir with checked out files. Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i git clone current_git_dir  new_git_dir You can then pull/push from new_git_dir. Only if main is checked out in the first repo, then you can't push main. Either name it differently (and then merge it later), or checkout something else at the orig. Mind the 2nd clone will see your local branches. so if they are diverged, it sees the diverged version that you have. To get the origin into the 2nd clone ,the first repo must be fast- forwarded/merged/rebased to the origin further more all 2ndar repos can have a 2nd remote to the origin at github. So you can updated them from github, but also sync between them and your first local repo. (the can also have additional refs connecting them bypassing the "first local", you can have a spider web of connections). you can also have a local bare/mirror, and have all repos connect to - github - the mirror  (which does not ever need to pull from github / in fact you can just create it as a new empty bare repo) then all repos will pull/push to github. But when you want to sync, you push the one branch to the bare repo, and have others pull from there. But honestly, it's just an unnecessary redirection. ---------------------------------------------------------------------- BSaidus · 2024-01-28 18:14 Thank you @Martin_fr, @TRon for your help. I wil give you a simple scenario with a remote repo in github and a cloned bare local repos: In the attached image, I cloned into a repo bare this URL: https://github.com/opnsense/core.git after few days, I want to update the repos using tortoisegit and fetch a new modifications from remote (https://github.com/opnsense/core.git). But It do not update. See the attached images, and remark the dates. Thank you. ---------------------------------------------------------------------- Martin_fr · 2024-01-28 19:03 Yes, I understand. --bare does not work. The bare repo will get the new commits (if you have the sha, you can access them), but it does not update the branch heads. So it wont work. Apparently (not tested) https://stackoverflow.com/questions/3382679/how-do-i-update-my-bare- repo#answer-17844460 there may be a way to fix it. (at least for "git fetch" Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i git config remote.origin.fetch 'refs/heads/*:refs/heads/*' So if you do need the bare/mirror in the middle.... Or you create your mirror from shell with --mirror and after that it should work in tortoise (not tested). ---------------------------------------------------------------------- BSaidus · 2024-01-28 21:30 Thank you @Martin_fr, and thanks to all other ones. ---------------------------------------------------------------------- TRon · 2024-01-28 21:35 Quote from: BSaidus on January 28, 2024, 10:30:24 pmThank you @Martin_fr +1 because I literally know nothing about tortoise (let alone anything about its particularities  ). ---------------------------------------------------------------------- BSaidus · 2024-01-29 08:16 Quote from: TRon on January 28, 2024, 10:35:29 pmQuote from: BSaidus on January 28, 2024, 10:30:24 pmThank you @Martin_fr +1 because I literally know nothing about tortoise (let alone anything about its particularities  ). @TRon, thank you too my friend. you answered to my question then you too, deserve to be thanked. ---------------------------------------------------------------------- Jiyahana · 2024-01-30 08:12 Hey I think you should check out the clone repository document too. ---------------------------------------------------------------------- BSaidus · 2024-02-02 09:21 Hello people. Excuse me another time, but I can not make a decision my self about choosing a suitable SVC. At this moment, I found 3 ones that seems popular: SVN, GIT, Mercurial. I have experience with SVN since we use it at work but the inconvenient with it is the fact that repos are remotely.   Can you advise me please what to choose, I'm lost  . thank you. ---------------------------------------------------------------------- ccrause · 2024-02-02 09:48 Quote from: BSaidus on February 02, 2024, 10:21:09 amAt this moment, I found 3 ones that seems popular: SVN, GIT, Mercurial. I have experience with SVN since we use it at work but the inconvenient with it is the fact that repos are remotely.   Can you advise me please what to choose, I'm lost  . There are several online articles comparing these systems, see e.g. this one: https://linuxconcept.com/git-vs-svn-vs-mercurial/ At a very high level I think choose between git or mercurial, since they follow the distributed repository model.  This means that you can have a local copy on your PC, which can then sync from time to time with a remote server.  I use git, mainly for collaboration with other projects (fpc, Lazarus). I have a folder with git tips & tricks, since I cannot remember all the different options and how best to apply them to specific cases.  Mercurial should be similar in functionality, perhaps a bit easier to use, but then with slightly fewer complex tricks.  The main deciding factor is maybe whether you select an online version control service (GitLab/GitHub/BitBucket/SourceForge,...), then you should choose whichever VCS that platform supports.  Since FPC/Lazarus uses git there should be several users on this forum with fairly good knowledge of using git. ---------------------------------------------------------------------- TRon · 2024-02-02 10:13 Quote from: BSaidus on February 02, 2024, 10:21:09 amI have experience with SVN since we use it at work but the inconvenient with it is the fact that repos are remotely.   Can you advise me please what to choose, I'm lost  . That explains a few things about some of the questions you asked before with regards to git (tortoise). I had a real hard time understanding why you needed a bare (in between) repository but if you have knowledge on SVN and tried to apply the same logic to git then it is more likely to come up with something like that approach that you took (not saying it is/was bad per se, just out of the ordinary for git). Which VCS to choose depends on your use case, your understanding of the implemented VCS (what do you personally favour/grasp) and your considerations to start using a VCS. ccrause already mentioned that it might be an idea to get a better understanding of the different implementations and I agree that that would indeed be a good idea. Every VCS implementation has its own pros and cons and depending on your use case a particular VCS implementation might be a better fit. Also note that git f.e. tries to support svn the best way it can by offering special features for it (though git and svn use different concepts, so be warned). There is one thing that I can suggest, no matter which VCS solution you choose: try to do/learn it from the command-line. GUI's work imho confusing and are impossible to solve every issue that you come across when working with VCS so in the end you always end up on the command- line anyhows. In case you are really new to the concept of a certain implementation then you can usually start simple and work your way up by example/manual. Quotethe fact that repos are remotely. As for an example on git and svn support: git to the rescue ---------------------------------------------------------------------- Martin_fr · 2024-02-02 10:20 Quote from: BSaidus on February 02, 2024, 10:21:09 amI have experience with SVN since we use it at work but the inconvenient with it is the fact that repos are remotely. There is a "svn to git" cheat-sheet on our wiki. In case you should decide for that. Though you will probably find many such cheat-sheets for all combinations. I don't know mercurial. Git has the advantage of requiring almost no setup for local repos. And keeping the option open to later sync it with a private repo at github/lap/... as backup. On Windows, TortoiseGit will ease the transition from svn, as TG features an almost svn like approach to use git (sounds strange, yes) However, to be fair: Learning git is a steep curve. You start at the deep end of the pool. Because even if you stick to a subset of easy- use features, you will - if only by accident - end up in a situation that requires more knowledge. So there will be a few headaches spread out over time. On the other hand, as long as you have a place were you can ask questions (like here), it will be manageable. And IMHO, the result is well worth it. So yes, support could be a factor: For which of them can you get support? For svn you probably have your work mates, and also your know it well and wont need much support. For git, you can ask here, and there are plenty of tutorials, due to its popularity.  For mercurial, you need to research that yourself. Personally I am a big git fan. It does offer me way more than just storing my history. - Easy (and free) backup to one (or more) private repo at git...hub/lab/... - Easy synchronizing between desktop/laptop/virtual machines. Sync without need for a server. - Easy sync even just between folders (yes git can have another folder as "remote" / any amount of folders and servers as any amount of remotes) - Storage for all sort of unfinished business (a branch is as simple as keeping a patch in a file / in fact much better) - temp storage, that I can later transform into one or more nicely organized commits (yet, while writing the code, I can store every attempt of trial and error, if I need to make some proof of concept attempts) ---------------------------------------------------------------------- marcov · 2024-02-02 10:44 Quote from: Martin_fr on February 02, 2024, 11:20:13 amOn Windows, TortoiseGit will ease the transition from svn, as TG features an almost svn like approach to use git (sounds strange, yes) The GIT tortoise is not up to the level of the SVN though. QuoteHowever, to be fair: Learning git is a steep curve. You start at the deep end of the pool. Because even if you stick to a subset of easy-use features, you will - if only by accident - end up in a situation that requires more knowledge. So there will be a few headaches spread out over time. On the other hand, as long as you have a place were you can ask questions (like here), it will be manageable. And IMHO, the result is well worth it. Also: afaik you can do (accidental) damage to the repository with GIT, but not with SVN. At least that tidbit should guide backup policies. Quote- Easy synchronizing between desktop/laptop/virtual machines. Sync without need for a server. (in this age of RPis with SSD not such a big deal anymore) Quote- Storage for all sort of unfinished business (a branch is as simple as keeping a patch in a file / in fact much better) - temp storage, that I can later transform into one or more nicely organized commits (yet, while writing the code, I can store every attempt of trial and error, if I need to make some proof of concept attempts) But that also means getting really deep into it, and its management. It also heavily depends on workload if you actually benefit from that. Even after 2 years, GIT still feels like a VCS construction kit rather than a finished product. Afaik tortoiseHG (for mercurial) is more advanced than tortoisegit, allowing many more operations visually. But Mercurial is increasingly getting an island, having hit peak in the early 2010s. ---------------------------------------------------------------------- Martin_fr · 2024-02-02 11:14 Quote from: marcov on February 02, 2024, 11:44:58 amAlso: afaik you can do (accidental) damage to the repository with GIT, but not with SVN. At least that tidbit should guide backup policies. Well, if you have a "local only" => then your repo-data is in the .git folder inside your project. If you change/delete any files in that folder (by accident or otherwise) then you can cause damage. I haven't done local svn, but - from hear say - you need a 2nd folder as the storage? You can set up your local git with an external folder (either as remote or using worktree / and worktree wont need push), then you have that danger averted. Othewise: - In both svn and git, you can loose not-yet-committed data. - In git you can drop/change branches => and that will make it *seem* as if you loose commits. If the latter happens to you, you have (with a default setup) IIRC 6 weeks time (worst case 2 weeks) to put those commits back on a branch. (Details, when/if needed). You can - in git - also end up in some state, where you just wont know how to get back to normal. (And might decide to delete/restart with a backup). That isn't exactly "damaged the repo". And you can get out of it by asking. Common case is the first time someone make a "detached checkout". And then makes local changes. .... It's not lost, but it will feel like it. ---------------------------------------------------------------------- Martin_fr · 2024-02-02 11:30 Quote from: marcov on February 02, 2024, 11:44:58 amEven after 2 years, GIT still feels like a VCS construction kit rather than a finished product. Well, that is because it includes a "VCS construction kit". Well, in some sense every VCS includes a VCS construction kit, it must be build from something. But, git exposes the VCS construction kit. git exposes so called "plumbing" commands. Those are the basic instructions from which the end-user commands are made up. Example https://git-scm.com/docs/git-stash Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i git stash create ....Quote    Create a stash entry (which is a regular commit object) and return its object name, without storing it anywhere in the ref namespace. This is intended to be useful for scripts. It is probably not the command you want to use; see "push" above. IMHO That should not be in the regular documentation, or at least "intended for scripts" should be much more explicitly pointing out: This is for playing with the internals of git. ---------------------------------------------------------------------- ccrause · 2024-02-02 11:56 Quote from: Martin_fr on February 02, 2024, 12:14:27 pmQuote from: marcov on February 02, 2024, 11:44:58 amAlso: afaik you can do (accidental) damage to the repository with GIT, but not with SVN. At least that tidbit should guide backup policies. Othewise: - In both svn and git, you can loose not-yet-committed data. - In git you can drop/change branches => and that will make it *seem* as if you loose commits. If the latter happens to you, you have (with a default setup) IIRC 6 weeks time (worst case 2 weeks) to put those commits back on a branch. (Details, when/if needed). Refer to this site for some recovery tips. ---------------------------------------------------------------------- marcov · 2024-02-02 13:12 Quote from: Martin_fr on February 02, 2024, 12:30:41 pmQuote from: marcov on February 02, 2024, 11:44:58 amEven after 2 years, GIT still feels like a VCS construction kit rather than a finished product. Well, that is because it includes a "VCS construction kit". I meant more that a finishing touch to the top layer isn't done. So it is not about having little used API/commands, it is about the workflow being a mess. (why do I need to click 5 buttons to update/sync my repo ?) ---------------------------------------------------------------------- Martin_fr · 2024-02-02 15:07 Quote from: marcov on February 02, 2024, 02:12:32 pmI meant more that a finishing touch to the top layer isn't done. So it is not about having little used API/commands, it is about the workflow being a mess. (why do I need to click 5 buttons to update/sync my repo ?) Button clicks would be Tortoise, or other frontend. Pretty sure "git" does not have buttons to click. Indeed, Tortoise could be more clever. If a push failed, I get offered to pull => IMHO ok, I have to confirm by ONE click. Then it will open the rebase, but IIRC (not sure) I have to click again to start it, and once more to stash pop (not sure...) And worst, it then forgot, that I wanted to push, and does not offer me that. About updating/syncing. If I update pull on the command line - If I have no changes in my worktree: then "git pull" or "git pull --rebase" should be enough. - If I have changes in my worktree: then yes there is the need to stash them first. Actually, you don't: git pull --rebase  --autostash And there is a git config for that too. Sure in SVN it just was "svn up" and it would always merge. No choice. No matter how good or bad the merge result would be. If you want to push ... In svn you would just "git commit" (which includes the push). And the server would merge. You wouldn't even notice. But if that merge created a bug (not a merge error), then that bug was there. And you likely didn't know. Git insists, that you get the changes from the server and merge them locally. Actually a good idea. Now you know, and you can test. (That most people, most of the time do not test, is not the fault of git). Then again, it is no secret that the user interface of git isn't polished at all. With svn, polished or not makes little difference. There just is little user interface that needs to be.... Apparently a long time ago someone to started on it. Afaik It went as far as adding "git switch" and "git restore" (which are infinitely better than "git branch" and "git checkout"). But it stopped there. And until now, apparently the git team couldn't even decide to mark those steps as final. The doc still says experimental. Sad I can't really make any fair judgment myself. I only know cvs (but so far down memory lane, I wouldn't count it), svn and git. Cvs and svn simple don't have many options. So judging how well the are organized is pointless. The issue with git on the other side, is not that it has many options, but how well they are (or are not) organized. Maybe someone who knows mercurial, if that has enough options to allow judging the interface for their organization... can tell how well that compares. ---------------------------------------------------------------------- marcov · 2024-02-02 15:28 My point is that I would recommend people to thoroughly evaluate if you actually need those features and if it matches your workflow. And I would not advise picking git as first VCS to learn. E.g. at work, I do a lot of development on different machines (with different hardware attached and/or mutually exclusive drivers), so developing a branch and quashing/rearranging commits has no use, since I have to push to test, or even to continue developing. Sure, you could try to mend that in various ways, but in the end managing all that is simply not worth the trouble, as the branches don't live enough, and are not complex enough  to earn all that effort back for one branch a year that lives a bit longer. That said I'm really glad that the fixes merging situation finally worked out. I did a pretty satisfying merging run before christmas before the 3.2.4 freeze kicked in. ---------------------------------------------------------------------- Martin_fr · 2024-02-02 17:11 Quote from: marcov on February 02, 2024, 04:28:06 pmMy point is that I would recommend people to thoroughly evaluate if you actually need those features and if it matches your workflow. And I would not advise picking git as first VCS to learn. Chicken or egg.... You wont know what you miss, if you don't know it exists. When I started using git, I had no idea how it would help me today. Of course it depends. If you are planing for a task with a deadline or narrow time constraints, you wont make allowance for learning new stuff. Stick with what you know. I am not sure if it makes a big difference if it is your first VCS or not.  It's more about the environment. Ideally you know people (locally) that can help you learn it. But at least you should have access to online help by real people. Learning git only by the git docs, and google or books => that I would not recommend. QuoteE.g. at work, I do a lot of development on different machines (with different hardware attached and/or mutually exclusive drivers), so developing a branch and quashing/rearranging commits has no use, since I have to push to test, or even to continue developing.I can't judge that for you. But even then, I often make micro commits. I commit code that isn't a complete commit. Maybe I just hit a point that compiles. Then I continue, if I suddenly realize that I broke compilation, I can compare with the commit I made. Once I have something that is good enough for a real commit (e.g. in your case push-to-test) I squash my micro commits and go ahead. Of course that is a personal preference. But before I knew the option even exists, I never even thought about it. ---------------------------------------------------------------------- marcov · 2024-02-02 17:35 Quote from: Martin_fr on February 02, 2024, 06:11:19 pmOf course it depends. If you are planing for a task with a deadline or narrow time constraints, you wont make allowance for learning new stuff. Stick with what you know. It is not just about finding time about learning GIT, but also the nature of the problem to be solved. If its complexity or general workflow (the multi machine nature of the problem) doesn't align with git, staying away from it indefinitely might be a good choice, since you will never recoup the time invested. Some people like complexity for complexity's sake, but I'm not one of them For everybody that had a epiphany about git use, there are many that only barely coexist. I've been using git for 2.5 years now, and I still don't see it. Any extra bit of power it gives costs magnitudes extra effort. Anyway, since nowadays git is the norm, avoiding git for first use is maybe counterproductive (even if it is not the softest landing, due to the construction kit argument). As to your micro commit detail: I'm working on my home machine on it, and tomorrow I have to go into the office or a customer for a testing day. How do I sync my laptop and my system (with the drivers) at work? In the past (2010-2014) I have looked into DVCS (mercurial, because Florian was experimenting with it, and Bazaar)  because of the road warrior scheme, being able to commit offline. But the advent of affordable data contracts and smartphones with hotspots made it a non issue, even with GIT. ---------------------------------------------------------------------- Martin_fr · 2024-02-02 17:53 OK, well. It seems I am one of the lucky few. I have been able to do many things more efficient since I use git. ---------------------------------------------------------------------- Martin_fr · 2024-02-02 18:00 Quote from: marcov on February 02, 2024, 06:35:08 pmAs to your micro commit detail: I'm working on my home machine on it, and tomorrow I have to go into the office or a customer for a testing day. How do I sync my laptop and my system (with the drivers) at work? Well you can have a private repo at any of the big hosters. Only accessible to you. A git repo can have any amounts of remotes. So you sync (and --force- with-lease) your private branches with that repo. If your laptop is at home, then your Laptop can also be configured to have your home desktop as a remote. Either you run "git daemon" on your PC, or you have the git repo an a shared folder and the laptop has the shared folder as a remote. So then your home pc may have origin = url-of-official-git-remote priv =  url-of-private-remote your laptop would have origin = url-of-official-git-remote priv =  url-of-private-remote pc = url-or-path-to-pc If you update all remotes on your laptop, the last one may fail, if the PC is not in reach. But the other 2 will still do the work. Git will automatically detect what it already got over any one of the connections -- EDIT: And yes, your PC repo can be the clone with checkout (with worktree). It can still and at the same time be a remote for others. In that case on your laptop the remote branch pc/main  will be the checked-out "main" branch, not the pc's origin/main (so the current local, not the pushed). That means, if your laptop can see the PC, it can pull branches, that you have not yet pushed. On the other hand: - if you want to push back from your laptop to your PC, you can do that. -  but whatever branch you push, that branch must at the time of pushing not be the active branch on the pc. So either switch temporarily away from that branch, or create a branch with a new name on the laptop. Well, you can configure your PC to allow update branches that are currently the active checked-out. But that is one of the bit that can get messy. So I don't recommend it. In that case better have a circular setup. Add the laptop as a remote for your desktop, and then your desktop and your laptop can pull from each other. For testing just connect a few folders Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i cd mytempgit init ./mainmkdir  ./Amkdir ./Bcd Agit clone ../main/cd ../Bgit clone ../main/ cd ../Agit remote add b ../b/cd ../Bgit remote add a ../a/  Now you can sync data between those 3 repos. ---------------------------------------------------------------------- BSaidus · 2024-02-02 18:56 Thank you people, all for your (answers) help and advices. The approche of Git is attractive ( save a whole copy of remote repos locally ), but it is little tricky to learn and TortoiseGit is not so complete as TurtoiseSVN, rather the Git for windows is little big ( in size 400 MB installed on windows). The mercurial SVC is practically doing samething, small, fast, easy to learn, all in one and 90MB installed in windows. the TortoiseHg is complete GUI to manage all hg.exe commands. I will give a try to Mercurial. Thank you for help.