Reputation: 749
I'm trying to create a workflow where I create my local project, automatically create the remote bitbucket repo based on the project name, then clone that repo into the local folder I'm working from. The problem is, you can't clone into a folder with files. The workaround so far is to clone into a folder, then move the contents into my working directory.
This is what I have so far that's not working:
git clone https://U:[email protected]/user-account/{project_name}.git & mv {project_path}/{project_name}/.git {project_path}/../../
Upvotes: 2
Views: 634
Reputation: 129782
How do you "automatically make a bitbucket repository"?
The normal workflow is to make a bitbucket repository through their site. Now you can do the rest of the steps without a clone.
git init
cat > .gitignore # add the patterns you don't want tracked
git add -A
git commit -m "initial commit"
git remote add origin <the url to your bitbucket repo>
git push origin master
Upvotes: 0
Reputation: 20869
A few problems:
&&
, not &
{project_path}/
{project_path}/../../
, which is two directories up from where {project_path}
is. Is this correct?This should achieve what is probably your intention: (Getting a .git
that's linked to bitbucket into your local folder.)
git clone https://U:[email protected]/user-account/{project_name}.git --no-checkout tmp
mv tmp/.git {path_to_your_local_folder}/
rmdir tmp
Upvotes: 1