Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • F first-contributions
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 322
    • Merge requests 322
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • First Contributions
  • first-contributions
  • Merge requests
  • !10916
An error occurred while fetching the assigned milestone of the selected merge_request.

Fixed some minor errors in grammar

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/genosis/update-remove-branch-from-repo into master 6 years ago
  • Overview 0
  • Commits 3
  • Pipelines 0
  • Changes 1

Created by: genosis

Fixed some minor errors in grammar and updated the content a bit to make it sound better.

Compare
  • master (base)

and
  • latest version
    4505a495
    3 commits, 2 years ago

1 file
+ 6
- 6

    Preferences

    File browser
    Compare changes
additional-material/git_workflow_scenarios/removing-branch-from-your-repository.md
+ 6
- 6
  • View file @ 4505a495


# Remove a branch from your repository
If you have followed the tutorial up-to-now, our `<add-your-name>` branch has finished its purpose, it is time to delete it from your local machine's repo. This isn't necessary, but the name of this branch shows its rather special purpose. Its life can be made correspondingly short.
If you have followed the tutorial up-to-now, our `<add-your-name>` branch has finished it's purpose. It is now time to delete it from your local machine's repo. This isn't necessary, but the name of this branch shows it's rather special purpose. It's life can be made correspondingly short.
First, let's merge your `<add-your-name>` to your master, so to go to your master branch:
First, let's merge your `<add-your-name>` branch to your master branch. Switch to your master branch with the checkout command:
```
git checkout master
```
Merge `<add-your-name>` to master:
Merge `<add-your-name>` branch to master:
```
git merge <add-your-name> master
```
Remove `<add-your-name>` on your local machine's repo:
Remove `<add-your-name>` branch on your local machine's repo:
```
git branch -d <add-your-name>
```
You have now deleted your local machine's `<add-your-name>` branch and everything looks neat and tidy.
Though, at this point, you should still have the `<add-your-name>` branch in your GitHub fork. However, before you delete this, remember that you have sent a "Pull request" to my repo from this remote branch. So unless I've already merged it, don't delete this branch.
Though, at this point, you should still have the `<add-your-name>` branch in your GitHub fork. However, before you delete this, remember that you have sent a "Pull Request" to my repo from this remote branch. So, unless I've already merged it, don't delete this branch.
However, if I have merged your branch and you want to delete the remote branch, use:
```
@@ -26,6 +26,6 @@ git push origin --delete <add-your-name>
```
Now, you know how to tidy your branches.
With time, many commits will be added to my public repo. And the master branches of your local machine and of your GitHub fork won't be up-to-date. So in order to keep your repositories synchronized with mine, follow the steps below.
With time, many commits will be added to my public repo. As a result, the master branch of your local machine and of your GitHub fork won't be up-to-date. So, in order to keep your repositories synchronized with mine, follow the steps below.
#### [Keeping your fork synced with the repository](keeping-your-fork-synced-with-this-repository.md)
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference:
Source branch: github/fork/genosis/update-remove-branch-from-repo

Menu

Explore Projects Groups Snippets