Discard Unpulled commits to upstream

18 views
Skip to first unread message

Julien Cubizolles

unread,
Dec 30, 2015, 4:20:34 PM12/30/15
to ma...@googlegroups.com
I'm not sure I'm using the origin/upstream concepts how they should be
used. I've forked a github repository to add some custom changes, set
origin (at first push) to the fork in my personal github repo and set
upstream (through b u) to the repo I forked (zenorocha in the following
example).

Now whenever I commit to origin, magit-status indicates that I have some
unpushed commits to upstream. I thought the purpose of the upstream
branch was (at least in case of a fork) to give a default remote branch
for fetching, but that it would not be used for pushing: that's what the
origin branch is for. In my case I have no intention to push to the
upstream branch, nor do I have write access to it.

Is there some variable in magit to prevent it from reminding me that I
have unpushed commits to the upstream remote branch ?

Here is an example of the magit-status buffer.

--8<---------------cut here---------------start------------->8---
Head: org-mode Back to bold, more flashy colors
Merge: zenorocha/dracula-theme/master Release v1.2.0
Push: origin/org-mode Back to bold, more flashy colors
Tag: v1.2.0 (3)

Unpushed to zenorocha/dracula-theme/master (3)
acfee96 org-mode origin/org-mode Back to bold, more flashy colors
6a2ca97 No bold/height, more colors
bb158c5 origin/gnus-customization gnus-customization New faces for Gnus group/summary views
--8<---------------cut here---------------end--------------->8---

Julien.

Kyle Meyer

unread,
Dec 30, 2015, 4:58:07 PM12/30/15
to Julien Cubizolles, ma...@googlegroups.com
Julien Cubizolles <j.cubi...@free.fr> writes:

> I'm not sure I'm using the origin/upstream concepts how they should be
> used. I've forked a github repository to add some custom changes, set
> origin (at first push) to the fork in my personal github repo and set
> upstream (through b u) to the repo I forked (zenorocha in the following
> example).
>
> Now whenever I commit to origin, magit-status indicates that I have some
> unpushed commits to upstream. I thought the purpose of the upstream
> branch was (at least in case of a fork) to give a default remote branch
> for fetching, but that it would not be used for pushing: that's what the
> origin branch is for. In my case I have no intention to push to the
> upstream branch, nor do I have write access to it.

Right. In this setup, you can think of "Unpushed" as "Unmerged".
(IIRC, renaming this section to match this workflow was suggested
recently and may still be under consideration.)

> Is there some variable in magit to prevent it from reminding me that I
> have unpushed commits to the upstream remote branch ?

If you don't find the information useful, you can remove
magit-insert-unpushed-to-upstream from magit-status-sections-hook.

--
Kyle

Julien Cubizolles

unread,
Dec 30, 2015, 5:20:15 PM12/30/15
to ma...@googlegroups.com
Kyle Meyer <ky...@kyleam.com> writes:


> Right. In this setup, you can think of "Unpushed" as "Unmerged".
> (IIRC, renaming this section to match this workflow was suggested
> recently and may still be under consideration.)

Thanks for clarifying it. I'm glad to see that for once I was using git
the way it's supposed to :-)

>> Is there some variable in magit to prevent it from reminding me that I
>> have unpushed commits to the upstream remote branch ?
>
> If you don't find the information useful, you can remove
> magit-insert-unpushed-to-upstream from magit-status-sections-hook.

That will come handy. Considering the frequency of my micro-commits, this
list of unpushed commits would soon grow to fill the whole buffer.

Thanks again for your help,

Regards,

Julien.
----------

Kyle Meyer

unread,
Dec 30, 2015, 5:43:14 PM12/30/15
to Julien Cubizolles, ma...@googlegroups.com
Julien Cubizolles <j.cubi...@free.fr> writes:

> Kyle Meyer <ky...@kyleam.com> writes:

>> If you don't find the information useful, you can remove
>> magit-insert-unpushed-to-upstream from magit-status-sections-hook.
>
> That will come handy. Considering the frequency of my micro-commits, this
> list of unpushed commits would soon grow to fill the whole buffer.

Also, a less permanent solution would be to manually collapse the
section (e.g., by pressing 1) when it is getting too lengthy.

--
Kyle
Reply all
Reply to author
Forward
0 new messages