Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with local only branches #6

Closed
martin-ueding opened this issue Oct 2, 2013 · 8 comments
Closed

Does not work with local only branches #6

martin-ueding opened this issue Oct 2, 2013 · 8 comments

Comments

@martin-ueding
Copy link

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.

@msiemens
Copy link
Owner

msiemens commented Oct 3, 2013

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.

@martin-ueding
Copy link
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.

@msiemens
Copy link
Owner

msiemens commented Oct 5, 2013

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?

@martin-ueding
Copy link
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.

@msiemens
Copy link
Owner

msiemens commented Oct 6, 2013

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?

@martin-ueding
Copy link
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(-)
...

@msiemens
Copy link
Owner

msiemens commented Oct 6, 2013

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 😉)

@msiemens
Copy link
Owner

msiemens commented Oct 7, 2013

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants