Re: Git branching & pulling

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: Git branching & pulling

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:12

"Wink Saville" [off-list ref] writes:
quoted
Creation of a branch from another local one never has created
"branch.x.remote" or "branch.x.merge" entries. I am not even sure
that setting "branch.x.remote" to "." is working in the current version.
I tired to create the appropriate entries and it didn't work,
but maybe operator error.
quoted
BTW: There was some old behavior of "git pull" to always pull the master
branch from remote "origin" without any further parameters. I suppose that
you did not want this to happen in your example above ?!
I expected it to pull from its upstream (i.e. the branches parent).
While "I branched and that means I will always merge from that
branch" does not hold true for everybody, we do have an option
to make that easy to work in recent git.  Look in git-branch
documentation and check autosetupmerge configuration option.

I notice that Paolo did not update Documentation/config.txt
when he add this feature with 0746d19a; care to send in a patch
to correct this?

Re: Git branching & pulling

From: Josef Weidendorfer <hidden>
Date: 2016-06-15 22:43:12

On Wednesday 23 May 2007, Junio C Hamano wrote:
"Wink Saville" [off-list ref] writes:
quoted
quoted
Creation of a branch from another local one never has created
"branch.x.remote" or "branch.x.merge" entries. I am not even sure
that setting "branch.x.remote" to "." is working in the current version.
I tired to create the appropriate entries and it didn't work,
but maybe operator error.
quoted
BTW: There was some old behavior of "git pull" to always pull the master
branch from remote "origin" without any further parameters. I suppose that
you did not want this to happen in your example above ?!
I expected it to pull from its upstream (i.e. the branches parent).
While "I branched and that means I will always merge from that
branch" does not hold true for everybody, we do have an option
to make that easy to work in recent git.  Look in git-branch
documentation and check autosetupmerge configuration option.
Ah, I stand corrected: I just checked - git already allows to default
to even a local upstream for "git pull", not only a remote tracking
branch.

Very nice.

What about making "git rebase" without arguments default to
the stored upstream?

Josef

[PATCH] Document branch.autosetupmerge.

From: Paolo Bonzini <hidden>
Date: 2016-06-15 22:43:12

This patch documents the branch.autosetupmerge config option, adding
in commit 0746d19a.

Signed-Off-By: Paolo Bonzini  <redacted>
---

  config.txt |    7 +++++++
  1 files changed, 7 insertions(+)

	> I notice that Paolo did not update Documentation/config.txt
	> when he add this feature with 0746d19a; care to send in a patch
	> to correct this?
	
	Sure.

	Paolo.
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 179cb17..de3c276 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -280,4 +280,11 @@ apply.whitespace::
  	Tells `git-apply` how to handle whitespaces, in the same way
  	as the '--whitespace' option. See gitlink:git-apply[1].

+branch.autosetupmerge::
+	Tells `git-branch' and `git-checkout' to setup new branches
+	so that gitlink:git-pull[1] will appropriately merge from that
+	remote branch.  Note that even if this option is not set,
+	this behavior can be chosen per-branch using the `--track`
+	and `--no-track` options.  This option defaults to false.
+
  branch.<name>.remote::
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help