1

I cloned the files in gitlab, created a new branch, edited the files and finally pushed it. But somehow it created a new repository, a new branch in my github and has nothing in my gitlab. What should i do

2
  • you need to change your remote origin to gitlab, git remote add origin [email protected]/UserRepo.git. Commented May 22, 2022 at 15:15
  • If you cloned from GitLab, the push action would normally go to GitLab. See @AbidKhan's comment, but you might add the output of git config --list --show-origin to your question in case there's something odd with a global setting for a push URL. Other than that the answer is basically the same as "how do I drive to Tokyo instead of Osaka": you just choose that as your destination. Commented May 22, 2022 at 20:07

1 Answer 1

6

Check your git remote -v output in the root folder of your local cloned repository.

If you had "cloned the files in gitlab", the URL should have been a GitLab one (https://gitlab.com/... or an SSH git@gitlab:...)

If not, you might see a GitHub URL.

Changing it to an existing remote GitLab one would be:

git remote set-url origin https://gitlab.com/You/YourRepo
Sign up to request clarification or add additional context in comments.

3 Comments

hehe, a minor spelling mistake. "remote" instead of "rmeote"
@AbidKhan Thank you for noticing it. I have edited the answer accordingly.
no worries and most welcome!, we all are here to help each other :).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.