URI:
        _______               __                   _______
       |   |   |.---.-..----.|  |--..-----..----. |    |  |.-----..--.--.--..-----.
       |       ||  _  ||  __||    < |  -__||   _| |       ||  -__||  |  |  ||__ --|
       |___|___||___._||____||__|__||_____||__|   |__|____||_____||________||_____|
                                                             on Gopher (inofficial)
  HTML Visit Hacker News on the Web
       
       
       COMMENT PAGE FOR:
  HTML   The bare minimum for syncing Git repos
       
       
        mnahkies wrote 20 hours 0 min ago:
        > I used to throw every scrap of code onto GitHub in the vague hope of
        “sharing knowledge”
        
        I looked at a random repo today, and used some of its (MIT licensed)
        code as a starting point.
        
        It was an expo plugin for managing android key stores, I didn't need
        most of what it did, and I went a different direction in the remaining
        bits - but it still helped me do that quickly. That won't show up in
        any stats the author can see, but I appreciate their contribution
       
        qudat wrote 21 hours 15 min ago:
        I use bare git repos and then a statically generated git web viewer
        using
        
  HTML  [1]: https://pgit.pico.sh
       
        estimator7292 wrote 21 hours 41 min ago:
        When I quit my last job, I was the only employee left that understood
        our tech stack. The other was a mechanical engineer and industrial
        designer. Because I felt that CEO could barely comprehend what git is
        or why it's important to pay AWS on time, I made a full backup of
        everything on a USB hard drive.
        
        If you ever need to do this, it can be as simple as "git mirror", with
        extra steps for LFS and other addons.
        
        That guy definitely did not deserve me to give him $100 of my own
        personal hard drive stash but out of some sick sense of professionalism
        I felt I had to give him a failsafe archive. Because, you guessed it,
        not one byte of the entire company was backed up anywhere.
       
          Ferret7446 wrote 16 hours 32 min ago:
          I'd be careful with that. He sounds like he'd be the dog that bites
          the hands and sue your for stealing company code
       
        socalgal2 wrote 22 hours 17 min ago:
        It's common to sync via ssh
        
            git clone ssh://mydyn.dns/path/to/repo
        
        If you have unique ssh settings you can put them in .ssh/config
        
        but fyi, depending on your needs, git clone/push/pull doesn't sync
        everything. For example it doesn't sync .git/hooks
       
        blibble wrote 22 hours 23 min ago:
        I know you're not really supposed to do it, but I've kept my git bare
        repos in syncthing for years
        
        as long as you don't work on two machines at once and they're always
        online it's ... fine
        
        (I do have a daily backup though)
       
        tomjuggler wrote 23 hours 47 min ago:
        Cool! I wrote a similar blog post last year when I decided to "Cut
        GitHub out of the loop" [1] My motivation was mainly the fact that
        Bitbucket cut their free tier, and who knows how long GitHub will be
        free? So I tried and found out how easy git actually is to sync without
        third parties
        
  HTML  [1]: https://www.circusscientist.com/2025/07/23/cutting-github-out-...
       
          MonkeyClub wrote 22 hours 53 min ago:
          > and who knows how long GitHub will be free?
          
          Apparently for as long as it will enable Microsoft to profit by
          training its LLMs on people's code.
          
          For people uncomfortable with working on free/libre stuff with git
          directly I always suggest Codeberg as an alternative, but hands on
          git is also an excellent option.
       
        tonymet wrote 1 day ago:
        Wait until you hear about subtree
       
        pwdisswordfishy wrote 1 day ago:
        > You can’t push changes to a non-bare repo – if you try, Git will
        reject your push.
        
        Sure you can. If the repo has branch foo checked out, but you're
        changing branch bar, it will happily let you push to bar (or bar->baz).
        And even if both are working with the same branch, whether or not you
        get a warning or it's accepted or rejected is controlled by
        'receive.denyCurrentBranch'.
        
        > Because nobody can “work” inside a bare repo, it’s always safe
        to receive pushes from other locations
        
        Mmm... it's "safe" depending on what you're pushing and  what's on the
        other end, which is no different from trying to push to a non-bare
        repo.
       
          tonymet wrote 1 day ago:
          This is one of gits best features . SSH deploys with offline remote
          version tracking
       
            fragmede wrote 23 hours 38 min ago:
            GitHub having a connection of ssh public keys is another feature
            that's really neat. You can give someone access to your server
            without having to give them a password somehow.
       
              embedding-shape wrote 23 hours 1 min ago:
              Another nice little "hidden" thing is that you can get people's
              public keys from just a GitHub username, and be kind of sure it
              is keys in active use, by doing [1] .
              
              Adding access to a new user? `curl [2] >>
              /home/user/.ssh/authorized_keys`
              
  HTML        [1]: http://github.com/$username.keys
  HTML        [2]: https://github.com/embedding-shapes.keys
       
                fragmede wrote 19 hours 40 min ago:
                That is what I was saying. Thank you for giving the
                instructions I didn't have the time to write out!
       
                tonymet wrote 22 hours 16 min ago:
                this is a really neat trick
       
              tonymet wrote 23 hours 8 min ago:
              Exactly.  And it’s great to move code around without having to
              add keys to GitHub/gitlab. Wherever you have ssh access you can
              push refs , build and deploy.    Great for embedded systems where
              you may have dozens and you don’t want to add keys to GitHub
              for each one.
       
        jonathanlydall wrote 1 day ago:
        > You can’t push changes to a non-bare repo – if you try, Git will
        reject your push.
        
        You can push to a folder with a non-bare Git repo, it’s just that you
        can’t push the same branch which it has checked out.
        
        Or in other words, if you get an error when trying to push to a folder
        with a checked out repo, push to a different remote branch.
        
        (I do this regularly between WSL and the Windows host)
       
        kvikshaug wrote 1 day ago:
        I had a collection of bare repos like this on a private server for a
        while, but eventually decided to move them to a self-hosted forgejo
        instance. It provides a nice web interface, and can be configured to
        create a new repo simply by pushing to a new non-existing repo name,
        super handy.
       
        ghosty141 wrote 1 day ago:
        Im quite happy with my setup.
        
        I have the stock git server on a vm, gitweb to view things in the
        browser and gitolite for basic permission management.
        
        Very low tech, almost no maintenance necessary and I dont more for
        hosting personal projects
       
        _ache_ wrote 1 day ago:
        You know you can send commit by email ?
       
          alansaber wrote 1 day ago:
          Funny to imagine they may have thought this would be a key USP when
          developing the feature.
       
            matt_kantor wrote 23 hours 9 min ago:
            Git was designed for Linux kernel development, which still uses
            email patches for contributions.
       
              alansaber wrote 22 hours 19 min ago:
              I stand corrected, email appears to be a perfectly logical way of
              sharing pull requests.
       
                atq2119 wrote 21 hours 54 min ago:
                Comment threads certainly work better through email than on
                GitHub PRs, at least when you can use a good email client
                (i.e., running locally, and not Outlook).
                
                The challenge is integration with CI and other automatic work
                flows.
       
        donatj wrote 1 day ago:
        It's interesting to me every time one of these "I just figured out I
        can use git without GitHub" posts comes up.
        
        The entire design of git was intended to be decentralized. You really
        don't even need the centralized bare repo! You can just point your
        machines at each other. With Tailscale these days that's especially
        easy.
        
        Admittedly, I'm getting old, but for the first couple years I used git
        professionally ~2008-2011 we just pulled from each other's machines.
        Directly over SSH. We worked in an office, all had each other's
        machines as remotes. "Hey, is that feature done? Cool, I'll pull it".
        It worked really well.
        
        Eventually we tossed a bare repo up on a server in the office and
        switched to push instead of pull. Finish a feature? Push it up! At some
        point our devops guy installed Gitlab around that, but we never really
        used the web ui.
        
        Winds changed, we moved to GitHub, eventually a pull request / code
        review workflow. Here we are now.
       
          pimlottc wrote 1 day ago:
          GitHub did an incredibly good job of capturing mindspace around git,
          to the extent that many users don’t realize that there is any
          distinction between the tool and the hosting platform.
       
            varun_ch wrote 1 day ago:
            I’m not sure if this is a large scale thing, but I know it’s
            definitely true for myself and some others.
            
            My first exposure to Git and GitHub was through GitHub Pages. I was
            told to use the GitHub web editor, ignore all the ‘git’ stuff,
            and just write the HTML files there. Then I grew into using GitHub
            desktop and later VSCode’s git integration. At no point did I
            have to use ‘git’ on the command line so I didn’t really
            understand what the tool did or why. I think many people simply
            don’t see git without GitHub. Some even see GitHub without
            touching git eg. see the infamous ‘I am new to GitHub and I have
            lots to say’ post
            
  HTML      [1]: https://www.reddit.com/r/github/comments/1at9br4/i_am_new_...
       
          mettamage wrote 1 day ago:
          > Admittedly, I'm getting old, but for the first couple years I used
          git professionally ~2008-2011 we just pulled from each other's
          machines. Directly over SSH. We worked in an office, all had each
          other's machines as remotes. "Hey, is that feature done? Cool, I'll
          pull it". It worked really well.
          
          Haha I'm jealous.
          
          We used Airdrop.
          
          And then I was like "shouldn't we use git?"
          
          "Nah, this works fine, you have the code you need now, don't you?"
          
          I was still in my second year of my information science bachelor and
          he was +60 years old and had programmed for over 2 decades. I was not
          going to argue with someone that experienced. In retrospect, I should
          have. But I'd probably been shot down with being "that youngster that
          always wants to use new technologies" (despite git not being that new
          anymore).
       
            cratermoon wrote 21 hours 41 min ago:
            I recall a time when github was having an outage at the same time
            me and a coworker were trying to fix a high priority issue.
            I had pushed my changes before the outage but he couldn't pull
            them.
            I proposed that I share my repo locally so he could pull from me,
            but he looked confused
            and didn't get it,
            so I let it drop.
       
          inatreecrown2 wrote 1 day ago:
          Funny you mentioned Tailscale, since the Author seems to work there.
       
          1718627440 wrote 1 day ago:
          Yeah, you can even just push to an USB stick, if you don't have an
          Ethernet cable available.
       
            aquariusDue wrote 19 hours 28 min ago:
            I sometimes clone stuff around my local filesystem and pretty much
            yeah it's a shame GitHub has captured so much of the mindshare
            around git.
       
       
   DIR <- back to front page