Search code examples
gitwampbitbucketgit-pushgit-clone

Using GIT and Bitbucket, should I push to Bitbucket from local dev or import and clone?


I am using a WAMP server to do local development and I have recently started working with GIT. I wanted to use Bitbucket to keep a private backup copy of my work, which I think is what it's used for. I cant seem to understand whether I should start by uploading my project directory onto Bitbucket and then cloning that to my local development area or start by creating a repo in my local project folder and pushing that to Bitbucket, or whether there's a difference in the end result. Ultimately I wanted to have everything duplicated to Bitbucket.

EDIT I read this but I don't think it answers my question because it is talking about cloning a local repo to Bitbucket whereas I'm asking about importing a local repo, which Bitbucket do support and then cloning it from Bitbucket to my local dev, which BB do support also.


Solution

  • Either way works, but if you do a proper import, you will also be importing your previous git history, which you may want.

    But generally speaking, creating a new git repo in bitbucket and (somehow) moving files into it, committing, and pushing isn't really so bad.