git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: stdedos@gmail.com
To: git@vger.kernel.org
Cc: stdedos+git@gmail.com, sandals@crustytoothpaste.net
Subject: Branches, upstreams, rebases and logistics
Date: Tue, 30 Mar 2021 23:28:52 +0300	[thread overview]
Message-ID: <20210330202852.9673-1-stdedos+git@gmail.com> (raw)

I was reading this thread:
https://lore.kernel.org/git/YFP+KuUn99vftBIC@camp.crustytoothpaste.net/

and, in specific:
> ..., many fixup and squash commits and near constant rebases.

which speaks to me somewhat heavily.

As this could be a discussion forum, I'd like to see
how other people are dealing with / have done for these:

I clone a repository, I do changes on top of a branch,
I push for review, ... and the cycle continues until merging.

It is trivial, when native `git push/pull` is used to push/pull
to/from one remote which I have access, as `pull --rebase` works
magically in keeping the local state up-to-date.

It also works with the repos that you do not have direct access to
push natively on the branch nowhere, as you can keep using the
`pull --rebase` to sync, and "push" with some other method
(`refs/for`, `git-send-email`, or others which I don't know).

However, with the Github way of working, that means:
I have two remotes, (origin and upstream), on which, I develop and
push on the `origin`, but I am really tracking/rebasing on/from `upstream`.

I cannot `--track` upstream, as plain `git push` won't work, and
for pull, I have to separately `git fetch --all`, `git rebase upstream/<branch>`

- OR -

I have a branch, which depends on top of another branch (not yet merged upstream).

o - origin/master
 \
  o---o---o---o
  |            \
  fix/local     o--o - (fix/depends-on-local)

For brevity, I am setting "git branch --set-upstream-to=fix/local",
which helps, when rebasing fix/local on top of origin/master, to rebase
fix/depends-on-local on top of fix/local.

However, as noted above, a branch cannot be pushed upstream easily and
have a different upstream set at the same time.

I know my logic/understanding is lacking somewhere;
I am looking forward to enlightenment :-D

             reply	other threads:[~2021-03-30 20:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30 20:28 stdedos [this message]
2021-03-31 11:32 ` Branches, upstreams, rebases and logistics Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210330202852.9673-1-stdedos+git@gmail.com \
    --to=stdedos@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sandals@crustytoothpaste.net \
    --cc=stdedos+git@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).