M
M
McMike2016-11-01 07:52:00
git
McMike, 2016-11-01 07:52:00

What should I do if I cloned a project not from a fork?

I cloned the project not from my fork, but from the main repository. Now I can't push.
What to do in such cases? Is it possible to switch to it after creating a fork, or do I need to clone the project from the fork again?
Is it possible to push into your own fork by leaning not from a fork?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
McMike, 2016-11-01
@McMike

In short, just change the server from the main server to your fork in the git config.
...not sure if it would work

A
Alexander Ruchkin, 2016-11-01
@VoidEx

Create a fork, then

git remote add my https://...
git pull my master
git push --set-upstream my master

Through `remote` it will also be possible to remove an unnecessary source

A
abcd0x00, 2016-11-02
@abcd0x00

What to do in such cases?

Rename the remote source (origin). This is adding a source that needs to be made initial, under some name. Then you delete the source with the name origin, and then you rename the added source from some name to origin.
All commands are described in the help:
(There are also shorter options, but you do it in a long way so that in case of any mistakes you don’t lose your way and do everything again.)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question