This topic describes how to keep your workspace tidy after your pull request is merged and closed.
This procedure confirms that your commit is now in the main
branch of the angular/angular
repo.
github.com
for your commitIn a web browser, open https://github.com/angular/angular/commits/main
.
Review the commit list.
Find the entry with your GitHub username, commit message, and pull request number of your commit. The commit number might not match the commit from your working branch because of how commits are merged.
If you see your commit listed, your commit has been merged into angular/angular
and you can continue cleaning up your workspace.
If you don't see your commit in the list, you might need to wait before you retry this step. Do not continue cleaning your workspace until you see your commit listed in or after the log entry that contains origin/main
.
If you see your commit listed above the log entry that contains origin/main
, then you might need to update your clone of the angular/angular
repo again.
After you see that the commit from your pull request has been merged into the upstream angular/angular
repo, update your fork.
This procedure updates your clone of personal/angular
on your local computer and then, the repo in the cloud.
Perform these steps from a command-line tool on your local computer.
From your workspace directory, run this command to navigate to your working directory. Remember to replace personal
with your GitHub username.
cd personal/angular
Run this command to check out the main
branch.
git checkout main
Run this command to update the main
branch in the working
directory on your local computer from the upstream angular/angular
repo.
git fetch upstream git merge upstream/main
Run this command to update your personal/angular
repo on github.com
with the latest from the upstream angular/angular
repo.
git push
Run this command to review the commit log of your fork.
The main
branch on your local computer and your origin repo on github.com
are now in sync with the upstream angular/angular
repo. Run this command to list the recent commits.
git log --pretty=format:"%h %as %an %Cblue%s %Cgreen%D"
In the output of the previous git log
command, find the entry with your GitHub username, commit message, and pull request number of your commit. The commit number might not match the commit from your working branch because of how commits are merged.
You should find the commit from your pull request in or near the log entry that contains upstream/main
.
If you find the commit from your pull request in the correct place, you can continue to delete your working branch.
After you confirm that your pull request is merged into angular/angular
and appears in the main
branch of your fork, you can delete the working
branch.
Because your working branch was merged into the main
branch of your fork, and the pull request has been closed, you no longer need the working
branch. It might be tempting to keep it around, just in case, but it is probably not necessary. If you keep all your old working branches, your repository can collect unnecessary clutter.
From your workspace directory, run this command to navigate to your working directory. Remember to replace personal
with your GitHub username.
cd personal/angular
Run this command to check out the main
branch.
git checkout main
Run this command to delete the working branch used in the pull request from your local computer. Replace working-branch-name
with the name of your working branch.
git branch -d working-branch-name
Run this command to delete the working branch from your personal/angular
repo on github.com
. Replace working-branch-name
with the name of your working branch.
git push -d origin working-branch-name
After you delete the working branch for your last issue, you're ready to select another issue to resolve.
© 2010–2023 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/guide/doc-edit-finish