User Tools

Site Tools


git:git-pushing-to-another-url-after-cloning

This is an old revision of the document!


Back to git main page

If you have cloned a git repository and want to push it to another URL, you can push with changing uptream and update the configuration of the project with this new URL as new origin.

Example : we suppose we have an existing repository called dummy that we clone :

git clone https://https://gitlab.ensta-bretagne.fr/user62/dummy.git

Now, we consider the cloned content to be in master branch (change branch if it is not master, e.g. main). We will push the master branch in a repository with a new name, dummy2, and we update the configuration with

git push --set-upstream https://gitlab.ensta-bretagne.fr/user62/dummy2.git master
git remote set-url origin https://gitlab.ensta-bretagne.fr/user62/dummy2.git

Note that a better way to do it is to fork the repository using the web interface.

git/git-pushing-to-another-url-after-cloning.1734372595.txt.gz · Last modified: 2024/12/16 19:09 by admin