Rashi
Rashi

Reputation: 9

How to I clone a GitHub repo and push it to Gitlab?

I'm trying to clone a github repo, using :

$ git remote add upstream https://github.com/.......

but I get the error:

fatal: not a git repository (or any of the parent directories): .git

I'm using the format:

$ git remote add <choose a remoteID, not "origin">  <URL to GitLab/GitHub/Atlassian/BitBucket>

I've tried using the actual repo ID : using the string in meta content

<meta content="123456789" name="octolytics-dimension-repository_id" />

In this example, the ID of the repository is 123456789.

Upvotes: 0

Views: 1023

Answers (1)

ShaneQful
ShaneQful

Reputation: 2236

Are you in an existing repo ? If not just clone the repo normally using git clone e.g. git clone https://github.com/openwall/john.git

You can only add remotes to an existing local repo you have to do git init inside a folder to make it a repo first before adding a remote but I'd recommend just cloning it with the command above.

Upvotes: 1

Related Questions