I created a project using angular cli. Project is in directory dw-ng2-app
and it has several files generated by angular cli. I want to create a Bitbucket repository for this. My confusion is, when I create a repository in Bitbucket, it gives me 3 options
git clone [email protected]:username/angularcli.git
but this creates a new directory on my local machine named
angularcli which has .git directory. I am not sure if I can use this
option as my project is in different directory and moving it to
angularcli directory might affect it (not sure) git remote add origin
ssh://[email protected]/username/angularcli.git
but that doesn't
work as my current project directory is not a git repositoryHow can I move the angular cli project to bitbucket? Should I have created the repository first and then created angularcli project in the generated directory?
Create a new request. Name the request Bitbucket Upload , select POST as the request type, and Multipart as the content type. At the top, enter https://api.bitbucket.org/2.0/repositories/myaccount/myrepo/src for the URL, replacing myaccount and myrepo with your Bitbucket account and repository name.
If you already have a repository, you can view it in SourceTree. Click New, then Add Existing Local Repository. Select the repository your wish to add, then click Open. Your added repository appears under Local.
There are a couple of ways to do this, but the simplest may be to simply make your current project directory, a git repository.
Go to your project directory
cd dw-ng2-app
Initialize git repository
git init .
Add your current project to be tracked
git add --all
Make your initial commit
git commit -m "Initial commit for Angular project"
At that point, you can use the third, "existing project" option within BitBucket.
After you've created a new repo there, you can see its URL and use that to track your new repository with your local one
git remote add origin https://[email protected]:7999/yourproject/repo.git
git push -u origin master
[Here's a complete writeup from BitBucket if you need.][1]
note - I used git add .
originally in my example, and BitBucket recommends git add --all
. Either of these will work fine in your case.
[1]: https://confluence.atlassian.com/bitbucketserver/importing-code-from-an-existing-project-776640909.html
If you've created project using angulat-cli then it automatically created project with git initialisation. It also commits initial changes locally. So you just have to add remote origin and push the content.
-If repository is not initialise as git repository then:
cd dw-ng2-app
git add --all
git commit -m "commit message"
git push -u origin master
-If already initialise with git repository.
First of all go to directory dw-ng2-app : cd dw-ng2-app
add remote to your repository.
git remote add bitbucket https://[email protected]/yourproject/repo.git
push the changes:
git push -u origin master
here's master is name of branch in which you want to push the content.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With