Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Renaming a remote

    • 0
    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 340
    Comment on it

    Rename the existing remote repository :

    There could be a condition where you want to add a new repository and you will get the message like repository already exist, or in other case when you mistakenly set the remote name wrong, then we need to rename the remote repository.

    Git provides the 'git remote rename ' command to reset the remote repository. Following is the syntax of renaming the remote repository:

    $ git remote rename oldname newname

    The git remote rename command takes two arguments:

    1. An existing remote name, for example, 'origin'
    2. A new name for the remote repo, for example, 'newname'

    For example :

    First we will check the old remote repository name which we will rename to new repository.Here we will clone the repository using the HTTPS.

    $ git remote -v
    # View existing remotes
    # origin (fetch)
    # origin .git (push)
    $ git remote rename origin destination
    # Change remote name from 'origin' to 'destination'
    $ git remote -v
    # Verify remote's new name
    # destination .git (fetch)
    # destination .git (push)

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: