tj / tj/git-extras

git delete-current-branch

Open
#866 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
18.1k
Forks
1.2k
Avg merge
5d 17h
Merged PRs (30d)
1

Description

Hi @tj,

When your team do Merge Requests in web, like in Gitlab, your remote branch is deleted, but local current branch isn't.

To avoid user to go into develop branch, do a git pull and then execute git delete-branch branch-name, it would be interesting an method like this:

Command

git delete-current-branch

Instructions
branch=$(git branch --show-current)

git checkout develop
git pull
git branch -d $branch

What do you think about this?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the proposed git delete-current-branch command and review the shell sequence in the issue, especially how it identifies the current branch and uses develop. Done means the new command is available in git-extras and its behavior matches the documented instructions without leaving the user on the deleted branch.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, shell
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.