Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What to do after my branch was merged? #96036

Closed
firubat opened this issue Mar 31, 2025 · 3 comments
Closed

What to do after my branch was merged? #96036

firubat opened this issue Mar 31, 2025 · 3 comments

Comments

@firubat
Copy link
Contributor

firubat commented Mar 31, 2025

First of all thanks for the tutorial, it is really helpful and exactly what I was looking for!

My question (+improvement suggetion) is: What do I do with my branch, in my fork, after it has been merged? Do I also merge it with the main branch on my end? If so - how? Do I somehow close the branch aftetward? If so - how?

@aryanvaghasiya
Copy link

Once your PR is merged, you don’t need that branch anymore in your fork. You can safely delete it — either via the GitHub UI (there’s usually a button on the PR) or using:

git push origin --delete your-branch-name in terminal.

You don’t need to merge it into your fork’s main. Instead, keep your fork’s main up to date with the original repo by syncing it regularly.

@firubat
Copy link
Contributor Author

firubat commented Apr 5, 2025

Thanks. So to summarize possible steps are:

  • In GitHub, sync main branch via the "Sync" button
  • Locally, switch to main and do git pull
  • Then git push origin --delete your-branch-name

Is there some redundancy? Would you do something different?

@aryanvaghasiya
Copy link

Yep, that’s pretty much it!

There is a bit of overlap between syncing on GitHub and doing git pull locally — you only need one, depending on where you're working. If you’re mainly working locally, just git pull from the original repo (upstream), then git push to your fork if needed.

Deleting the branch afterward is a good cleanup step, and you're doing it right 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants