Menu

How to get all remote in git

We can get all the remote names and respective url with below command. 

  1. Below is the command to get the list of all remote added in git. 

    git remote -a or git remote -all 


  2. Below is the command to get the list of all remote with thier origin/remote URL.

    git remote -v

How to add or remove remote from a Git repository

To add a git remote other than origin, run the following command.

git remote add origin-name gitUrl

 


To remove a remote from local repo

git remote remove origin-name


Note Here: 

gitUrl is the url of your git repo.  

origin-name default origin, but we could provide any unique name.

How to clone a git repo with a new name

We can clone any Git repo with new name by specifying folder or directory name while doing the clone. 

The command will look like this.


Command to clone a Git repo with a new name

    git clone <repourl> <folder name>

After the git base url specify the folder or directory name. It will create a new folder with that name and clone into that.