I accidentally performed a git remote rm <remote_repo_name>
:(
Will a git remote add remote_repo_name <remote_repo_path>
add it back as a remote even though the remote already had previously pushed content ?
Yes.
git remote add
just tells your repository about the remote repository. It doesn't do anything with the content of that repo. So git remote rm
and git remote add
are inverse operations.
When you do a git fetch
, git will be smart enough not to download the stuff you already have locally again. This is a consequence of how git works under the hood and not really relevant to your question; you should just know that you've lost nothing by accidentally removing the remote.