Giter Club home page Giter Club logo

Comments (4)

earwig avatar earwig commented on July 18, 2024

@njamesp Hi; I'm having a bit of trouble figuring out the proper way to handle bare repositories. It seems like git does some strange things behind the scenes depending on how you have your repo set up.

Can you paste your repo's config file? Scrub URLs if you want but leave the rest of the file intact if possible. Also, what's your usual method for updating the mirrors (since git pull doesn't work, is it just git fetch or something else)? Thanks!

from git-repo-updater.

njamesp avatar njamesp commented on July 18, 2024

Thanks for the quick response! See below.

On May 30, 2015, at 2:30 PM, Ben Kurtovic [email protected] wrote:

@njamesp https://github.com/njamesp Hi; I'm having a bit of trouble figuring out the proper way to handle bare repositories. It seems like git does some strange things behind the scenes depending on how you have your repo set up.

[core]
repositoryformatversion = 0
filemode = true
bare = true
ignorecase = true
precomposeunicode = true
[remote "stash"]
url = ssh://[email protected]/ ssh://[email protected]/...
fetch = +refs/heads/:refs/remotes/stash/
[remote "origin"]
url = /Users/nparrish/Numerica/...
fetch = +refs/heads/:refs/remotes/origin/
Can you paste your repo's config file? Scrub URLs if you want but leave the rest of the file intact if possible. Also, what's your usual method for updating the mirrors (since git pull doesn't work, is it just git fetch or something else)? Thanks!

I usually do just git fetch, but that doesn’t update any tracking branches.
In a bare repo, you can do:
git branch Foo origin/Foo
But then if origin/Foo changes upstream, the local version of Foo does not change with a fetch.

So, the primary issue I run into is that you can’t checkout a branch to update it.


Reply to this email directly or view it on GitHub #14 (comment).

from git-repo-updater.

earwig avatar earwig commented on July 18, 2024

Thanks, I think I've got a satisfactory solution for this.

There was a bug with remote fetching in certain cases (but not yours); I fixed that in a9e2a1f.

In 5a4e49e I fixed the error you were having. Remotes are updated correctly, but no branches are modified, so gitup acts like a batch git fetch.

In 31a9477 I redid the way branch updates work. For any branch where you've explicitly set an upstream (such as by doing git branch foo origin/foo as you mentioned), gitup should correctly fast-forward it on updates, but won't do anything if a merge or rebase is required. Since you're we're dealing with bare repos here, that should always work, unless someone does something funny (forced pushes that break history?) in which case you'll have to deal with that manually.

from git-repo-updater.

njamesp avatar njamesp commented on July 18, 2024

Awesome. This is working much better now. Thanks for the quick fix.

Nick

On Jun 6, 2015, at 12:39 AM, Ben Kurtovic [email protected] wrote:

Thanks, I think I've got a satisfactory solution for this.

There was a bug with remote fetching in certain cases (but not yours); I fixed that in a9e2a1f a9e2a1f.

In 5a4e49e 5a4e49e I fixed the error you were having. Remotes are updated correctly, but no branches are modified, so gitup acts like a batch git fetch.

In 31a9477 31a9477 I redid the way branch updates work. For any branch where you've explicitly set an upstream (such as by doing git branch foo origin/foo as you mentioned), gitup should correctly fast-forward it on updates, but won't do anything if a merge or rebase is required. Since you're we're dealing with bare repos here, that should always work, unless someone does something funny (forced pushes that break history?) in which case you'll have to deal with that manually.


Reply to this email directly or view it on GitHub #14 (comment).

from git-repo-updater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.