public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* 1-800-GIT-HELP (how to delete a user branch?)
@ 2022-10-25 12:21 Gaius Mulley
  2022-10-25 13:09 ` Jonathan Wakely
  0 siblings, 1 reply; 3+ messages in thread
From: Gaius Mulley @ 2022-10-25 12:21 UTC (permalink / raw)
  To: gcc


Just wondering what is the safest way to delete a user branch?

[I used ./contrib/git-add-user-branch.sh and wanted to start over
 (user branch for m2 and gcc12)],
 
many thanks,
Gaius

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 1-800-GIT-HELP (how to delete a user branch?)
  2022-10-25 12:21 1-800-GIT-HELP (how to delete a user branch?) Gaius Mulley
@ 2022-10-25 13:09 ` Jonathan Wakely
  2022-10-25 13:15   ` Gaius Mulley
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Wakely @ 2022-10-25 13:09 UTC (permalink / raw)
  To: Gaius Mulley; +Cc: gcc

On Tue, 25 Oct 2022 at 13:23, Gaius Mulley via Gcc <gcc@gcc.gnu.org> wrote:
>
>
> Just wondering what is the safest way to delete a user branch?
>
> [I used ./contrib/git-add-user-branch.sh and wanted to start over
>  (user branch for m2 and gcc12)],

When you say start over, do you mean reuse the same branch name for a
different branch with unrelated history, but using the same name?

If yes, you can just force push the new history to the branch. That's
the simplest answer.

If you really want to delete the branch, then you just say:

git push --dry-run --delete REMOTE BRANCH
and if that looks right, remove the --dry-run option.

The REMOTE will be something like users/gaius and BRANCH will be
something like refs/users/gaius/heads/m2gcc12 depending on how you set
up your local user branches.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 1-800-GIT-HELP (how to delete a user branch?)
  2022-10-25 13:09 ` Jonathan Wakely
@ 2022-10-25 13:15   ` Gaius Mulley
  0 siblings, 0 replies; 3+ messages in thread
From: Gaius Mulley @ 2022-10-25 13:15 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc

Jonathan Wakely <jwakely.gcc@gmail.com> writes:

> On Tue, 25 Oct 2022 at 13:23, Gaius Mulley via Gcc <gcc@gcc.gnu.org> wrote:
>>
>>
>> Just wondering what is the safest way to delete a user branch?
>>
>> [I used ./contrib/git-add-user-branch.sh and wanted to start over
>>  (user branch for m2 and gcc12)],
>
> When you say start over, do you mean reuse the same branch name for a
> different branch with unrelated history, but using the same name?

yes

> If yes, you can just force push the new history to the branch. That's
> the simplest answer.

great thanks a lot!  I will try this approach

> If you really want to delete the branch, then you just say:
>
> git push --dry-run --delete REMOTE BRANCH
> and if that looks right, remove the --dry-run option.
>
> The REMOTE will be something like users/gaius and BRANCH will be
> something like refs/users/gaius/heads/m2gcc12 depending on how you set
> up your local user branches.

many thanks useful info.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-25 13:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-25 12:21 1-800-GIT-HELP (how to delete a user branch?) Gaius Mulley
2022-10-25 13:09 ` Jonathan Wakely
2022-10-25 13:15   ` Gaius Mulley

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