简体   繁体   中英

How to change remote repository with git

I recently downloaded a git repository from which looks promising as a base for a project I'm starting for a client.

Before making too many changes, I'd like to upload it to a separate repository. From googling, it looks like it may be as simple as this:

git remote set-url origin NEWURL

where NEWURL is the new repository address.

My question: is NEWURL the address that ends in ".git"?

eg

 https://myname@bitbucket.org/myname/my-new-app.git

Also, is it automatically uploaded after that? Or do I have to do any additional commands?

Yes, the process to set the remote URL is correct. Additional steps needed:

  1. Create a repository named my-new-app in BitBucket, under your account myname .
  2. Use git push -u origin master to push the code to the BitBucket repository.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM