Back to [[git:main-git|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 with:
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 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.