git-remote

How to change the URI (URL) for a remote Git repository?

被刻印的时光 ゝ 提交于 2019-11-25 22:04:01
问题 I have a repo (origin) on a USB key that I cloned on my hard drive (local). I moved \"origin\" to a NAS and successfully tested cloning it from here. I would like to know if I can change the URI of \"origin\" in the settings of \"local\" so it will now pull from the NAS, and not from the USB key. For now, I can see two solutions: push everything to the usb-orign, and copy it to the NAS again (implies a lot of work due to new commits to nas-origin); add a new remote to \"local\" and delete the

How do I delete a Git branch locally and remotely?

泪湿孤枕 提交于 2019-11-25 21:40:35
问题 I want to delete a branch both locally and remotely. Failed Attempts to Delete Remote Branch $ git branch -d remotes/origin/bugfix error: branch \'remotes/origin/bugfix\' not found. $ git branch -d origin/bugfix error: branch \'origin/bugfix\' not found. $ git branch -rd origin/bugfix Deleted remote branch origin/bugfix (was 2a14ef7). $ git push Everything up-to-date $ git pull From github.com:gituser/gitproject * [new branch] bugfix -> origin/bugfix Already up-to-date. What should I do