I'm using WordPress Sage so for every project I clone their repo. For my current project I want to push to a repo of mine though. Should I delete all Git files and start over, or can I keep them and somehow inform Git about my repo?
Asked
Active
Viewed 31 times
2 Answers
1
You should change the remote repo. See Git Basics | Working with Remotes.
git remote add origin /path-or-URL/to-repo

bahrep
- 29,961
- 12
- 103
- 150
-
When doing "git remote add origin github.com/my_account/my_repo.git"; I get "fatal: remote origin already exists.". – drake035 Aug 03 '16 at 15:52
-
1
Just add a new remote.
git remote add myrepo myuser@myserver
git push myrepo mybranch
If you want mybranch
to always push to myrepo, change the tracking information:
git push -u myrepo mybranch

blue112
- 52,634
- 3
- 45
- 54
-
When doing "git remote add origin https://github.com/my_account/my_repo.git" I get "fatal: remote origin already exists.". I tried to delete my repo but still got the same error. Any idea why? – drake035 Aug 01 '16 at 17:06
-
-
Thanks, worked (no error message this time). Then I did "git push" and it tried to push to old repo. Argh :( – drake035 Aug 02 '16 at 14:45
-