The outcomes of this blog are:
- How to Delete Upstream From Local Repository Using “git remote remove” Command?
- How to Delete Upstream From Local Repository Using “git remote rm” Command?
How to Delete Upstream From Local Repository Using “git remote remove” Command?
To remove the remote “upstream” from the local repository, the “git remote remove” command can be used. To do so, the instructions steps can be performed.
Step 1: Move to Git Repository
First, go to the required Git repository by utilizing the “cd” command:
Step 2: View Remote URLs List
Next, run the “git remote” command to get the list of remote URLs through the following command:
Step 3: Remove “upstream” Remote
Then, execute the “git remote remove” command along with the remote name “upstream” to remove it from the repository:
Step 4: Ensure Removed “upstream” Remote
Lastly, check the list of remote URLs to verify the specified remote name is removed:
According to the below-given output, the “upstream” remote has been successfully deleted from the local repository:
Let’s check out another way of removing the remote URLs from the Git local repository in the next section.
How to Delete Upstream From Local Repository Using “git remote rm” Command?
Another way to remove the “upstream” URL from the list is by utilizing the “$ git remote rm” command. Check out the below-provided steps for this particular purpose.
Step 1: Check Remote List
First, view the list of remote URLs using the “git remote” command:
It can be observed that the “upstream” remote name along with the remote repository URL exists:
Step 2: Remove “upstream” Remote
Next, run the following command to remove the particular remote URL:
Step 3: Verify Removed Remote
Lastly, verify that the particular remote URL is removed from the Git repository:
It can be seen that the removed remote does not exist in the list:
We have efficiently described the possible ways of removing the “upstream” remote from the Git local repository.
Conclusion
To remove the “upstream” remote from the local repository, there are two commands that can be utilized, such as “$ git remote remove upstream” or “$ git remote rm upstream” commands. To remove the particular remote, first, check the remote list and then run the “$ git remote <remove>/<rm> upstream” command. This blog provided the possible ways of removing the upstream remote from the Git local repository.