Import an existing, unversioned code project into Bitbucket Server
Import code from an existing project using the terminal by first cloning the repository to your local system and then pushing to an empty Bitbucket Server repository. If you have code on your local machine that is not under source control, you can put it under source control and import it into Bitbucket Server.
Assuming you have Git installed on your local machine, then:
- Locally, change to the root directory of your existing source.
- Initialize the project by running the following commands in the terminal:12345git initgit add --allgit commit -m "Initial Commit"
- Log into Bitbucket Server and create a new repository.
- Locate the clone URL in the nav panel on the left (for example:
- Push your files to the repository by running the following commands in the terminal (change the URL accordingly):1234git remote add origin https://[email protected]:7999/yourproject/repo.gitgit push -u origin master
Adding code to an existing project into Bitbucket Server
After first cloning the repository, you need to update project any time. Use the bellow code to push your updated code
$ git add --all
$ git commit -m "contra"
$ git push origin master
If you face any problem to puch your updated code, then you should push with force.
$ git push origin master -f