Skip to content

Does not work with local only branches #6

Closed

Description

@martin-ueding

I have a situation where I have a master branch, and several feature branches forked off each other. git-up just quits with a:

Can't update your repo because it doesn't has any remotes.

I would expect it to rebase/merge all my local branches against master.

Activity

  1. msiemens commented on Oct 3, 2013

    @msiemens
    Owner

    While I understand your request, PyGitUp is designed to be a replacement for git pull and in the case you described, git pull would complaining that there are no remotes.

  2. martin-ueding commented on Oct 5, 2013

    @martin-ueding
    Author

    No, I can use git pull on a repo that has no remotes at all. It merges with the branch that it trackes, and that works just fine. Therefore, I think that PyGitUp poses an artificial limitation here.

  3. msiemens commented on Oct 5, 2013

    @msiemens
    Owner

    Hmm.. I tried creating a setup, where git pull merges local branches, git pull complained about missing remotes. Could you describe in detail, how you created your setup?

  4. martin-ueding commented on Oct 5, 2013

    @martin-ueding
    Author

    This is my .git/config in that repo:

    [core]
            repositoryformatversion = 0
            filemode = true
            bare = false
            logallrefupdates = true
    [branch "content/contributions"]
            remote = .
            merge = refs/heads/master
    [branch "content/lagrange/sliding-pendulum"]
            remote = .
            merge = refs/heads/master
    

    I create feature branches with git checkout -b BRANCH -t and then I can use git pull to merge the tracking target into that branch.

  5. msiemens commented on Oct 6, 2013

    @msiemens
    Owner

    Thanks, I'll look into that.
    Just out of curiosity: I've never seen such a setup before nor can I find anything about it on the internet. Why did you prefer setting the remote to the same repo instead of using plain old git merge?

  6. martin-ueding commented on Oct 6, 2013

    @martin-ueding
    Author

    Well, if I am on a feature branch and do a git merge, it does not default to the upstream branch, although I could change the config to be as such:

    mu:~/Projekte/eigene-webseite (content/lagrange/sliding-pendulum<>) LC_ALL=C git merge
    fatal: No commit specified and merge.defaultToUpstream not set.
    

    With git pull, it defaults to the upstream branch, without any config setting. And if the upstream branch happens to be remote, it will be fetched automatically. For local branches, it does not make a difference, you are right there:

    mu:~/Projekte/eigene-webseite (content/lagrange/sliding-pendulum<>) LC_ALL=C git pull
    From .
     * branch            master     -> FETCH_HEAD
    ...
     126 files changed, 2114 insertions(+), 873 deletions(-)
    ...
    
  7. msiemens commented on Oct 6, 2013

    @msiemens
    Owner

    That's a really interesting way to deal with that.
    I've added some changes to make PyGitUp work with your setup and by the way fixed possible problems, where the local branch has been renamed (see aanand/git-up#52). I'll propably release it tomorrow (German time 😉)

  8. added a commit that references this issue on Oct 7, 2013
    17b7314
  9. msiemens commented on Oct 7, 2013

    @msiemens
    Owner

    Fixed in v1.1.0, you can update it via pip install -U git-up :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions