简体   繁体   中英

Git, Heroku - change linked repo and ignore local changes

I have a local repo that is linked to a bitbucket repo and to a heroku app. I imported that repo in github and want to sync this new github repo with my local copy and my heroku app.

As an added complication, I have local changes that I want to hold off on committing until I can sync up with github and set up a pipeline on heroku for staging, etc. I don't think this will matter, but I want to confirm that.

My belief is that all I have to do is change the remote in my local repo to point to the github repo and that nothing needs to be changed with respect to the heroku app since I still want this local repo to sync with heroku ... I only want to change the place where my code is stored from the bitbucket repo to the github repo.

git config remote.origin.url https://github.com/abc/abc.git

Am I thinking right here?

Yes, that would be:

git remote set-url origin https://github.com/abc/abc.git

A git push would work as before, but this time, to GitHub.

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