Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15

Re: basic question about push

From: Jay Soffian <hidden>
Date: 2016-06-15 22:48:05

On Sun, Jan 24, 2010 at 3:15 AM, Jeff King [off-list ref] wrote:
On Sun, Jan 24, 2010 at 07:04:59AM +0000, Russ Paielli wrote:
quoted
warning: updating the current branch
[...]
What does this mean in English? And what is the correct way to transfer my
revisions from my home computer to my work computer? Thanks.
It means your workflow will cause problems as the pusher magically
changes your repository's concept of "the latest commit" behind the
pushee's back. The workflow you want is described here:

 http://git.wiki.kernel.org/index.php/GitFaq#push-is-reverse-of-fetch
Aside, and I think we've discussed this before, but I wonder if it
would make sense to:

a) Add an option to clone such as "-p [<name>] | --push-as[=<name>]"
where <name> defaults to $(uname -n | cut -f1 -d.) This would setup
the cloned repo with a push refspec
"+refs/heads/*:refs/remotes/<name>/*". e.g.:

$ git clone -o host1 -p host2 ssh://host1/~/repo.git
$ cat repo/.git/config
...
[remote "host1"]
	url = ssh://host1/~/repo.git
	fetch = +refs/heads/*:refs/remotes/host1/*
	push = +refs/heads/*:refs/remotes/host2/*

b) The controversial part: make this option the default the default
when cloning from a non-bare repo. There would need to be some way to
turn it off.

Of course, I'm not sure this would be any less confusing for users.
Would they wonder why they have to merge to see their pushed changes
reflected on the pushed-to repo?

It does nicely make push symmetric to fetch between two non-bare repos
though, and I think maybe that makes more sense.

j.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help