4

I haven't really used any version control until now, when a colleague sent me an invite for a project that is hosted on bitbucket. I'm not entirely sure what the workflow is supposed to be, but I do know I have git installed on osx and have used it locally briefly.

Is the process just to git clone the repository and have it automatically download to a directory, where I would then work off of and commit to the hosted repository? I've done that in terminal and it dropped the files in my home directory. For git, can I move that directory to where my htdocs folder is, or does it have to "stay" there?

Next, I'm not sure how to integrate it into Sublime Text. I have git and package control installed, but when I Add Repository and enter the url the repository, it just says "added successfully" and I don't know where or if the files were downloaded.

Adam
  • 8,849
  • 16
  • 67
  • 131
  • I can't answer for the sublim text part, but as far as git is concerned you can move the cloned directory anywhere you like. It is 100% self-sufficient. All git meta-info is stored in the `.git` folder which appears in the top-level of the cloned directory. – Sébastien Dawans Jul 17 '13 at 06:18

1 Answers1

10

Is the process just to git clone the repository and have it automatically download to a directory, where I would then work off of and commit to the hosted repository?

You first work off locally, in the repo you have just cloned.
And you can clone it wherever you want on your local machine.

You first make a few commits (locally).

edit in git

You can then push those commits back to the bitbucket repo, which is your remote repository.

git commands

See for more on the DVCS (Distribted VCS) the answer "Sell me Distributed revision control"

Regarding SublimeText, you can look at plugins like SublimeGit, a Full-featured Git integration for Sublime Text 2 and 3 (but it cost 10$).

SublimeGit screenshot

Or sublime-text-2-git (free).

sublime-text-2-git commands

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks. Great answer. I have the free Git plugin already installed. I guess my question is really, how does my sublime git know where the remote repository is located? Is all that information located in the .git folder when I cloned it? – Adam Jul 17 '13 at 15:40
  • @Adam - yes. In the `.git` directory is (among other things) a file called `config` that contains that information. – MattDMo Jul 17 '13 at 15:46