Soumik Mukhopadhyay
Soumik Mukhopadhyay

Reputation: 11

Is it possible to clone Two different project one from Github and one from Bitbucket through git?

Is it possible to clone Two different project one from Github and one from Bitbucket through git into the same machine for working two different project?

Upvotes: 1

Views: 798

Answers (3)

CodeWizard
CodeWizard

Reputation: 142482

This is exactly what is git for, to work on multiple projects regardless if they are on the same server and more then that you can pull/push the same content to multiple repositories.

# Project 1
git clone <URL> folder1

# Project 2
git clone <URL> Folder2

Now you simply work on them like any other project on your machine.

Note

Git allow you also to "store" each repository in multiple remotes which mean that the same code can be in Github, bitbucket, gitlab etc.... - The same repository, all you need to do is to add a new remote

# Add multiple remotes to the same repository
git add <remote1 name> <url1>
git add <remote2 name> <url2>

# To view your remotes:
git remote -v

P.S

  1. If you are a new user I recommend cloning the project using ssh keys
  2. To sync multiple repositories you can use this tool (Unix) - https://myrepos.branchable.com/

Upvotes: 1

Aleksey Tsalolikhin
Aleksey Tsalolikhin

Reputation: 1668

Yes, you can. See the section "Cloning an Existing Repository" in the chapter "Git Basics - Getting a Git Repository" in the Git book. Just make sure you don't put the two projects in the same directory -- use a separate directory for each.

Upvotes: 0

Raju
Raju

Reputation: 2509

welcome to Stackoverflow!

Github and Bitbucket are built git as the base. So it should not matter if you are trying to clone the repo from any of them as long as you are doing it through git in your local.

I have done this with Github and Gitlab and it worked without any issues.

Upvotes: 1

Related Questions