User Tools

Site Tools


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

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
git:git-pushing-to-another-url-after-cloning [2024/12/16 19:09] admingit:git-pushing-to-another-url-after-cloning [2024/12/16 19:10] (current) admin
Line 3: Line 3:
 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. 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 :+Example : we suppose we have an existing repository called **dummy** that we clone with:
 <code bash> <code bash>
 git clone https://https://gitlab.ensta-bretagne.fr/user62/dummy.git git clone https://https://gitlab.ensta-bretagne.fr/user62/dummy.git
 </code> </code>
 Now, we consider the cloned content to be in master branch (change branch if it is not master, e.g. main).  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  +We push the master branch in a repository with a new name, **dummy2**, and we update  
-the configuration with+the configuration with :
 <code bash> <code bash>
 git push --set-upstream https://gitlab.ensta-bretagne.fr/user62/dummy2.git master git push --set-upstream https://gitlab.ensta-bretagne.fr/user62/dummy2.git master
git/git-pushing-to-another-url-after-cloning.txt · Last modified: 2024/12/16 19:10 by admin