You can init a git dir in an directory containing other files, after that you can add files to the repo and commit there.
Create a project with some code:
$ mkdir my_project
$ cd my_project
$ echo "foobar" > some_file
Then, while inside the project's folder, do an initial commit:
$ git init
$ git add some_file
$ git commit -m "Initial commit"
then for using bitbucket or such you add a
remote and push up
$ git remote add some_name user@host:repo
$ git push some_name
you also might then want to configure tracking branches etc. see
git remote set-branches and related commands for that.