If you have code on your local machine that is not under source control, you can prepare it by putting your code into a Git repository locally.
- From your terminal, change to the root directory of your existing code.
- Initialize the directory under source control from the following command:
1$ git init
- Add the existing files to the repository you have initialized:
1$ git add .
- Commit the files:
1$ git commit -m "initial commit of full repository"
On macOS, you can use single quotes or double quotes around the comment message. On Windows, you must use double quotes.
- Connect your new local Git repository to the remote repository on Bitbucket. To do so, enter
git remote add originwith the remote URL:1$ git remote add origin <bitbucket_URL>
You can find the URL next to the
git clonecommand for the repository:
- Push all the code in your local repo to Bitbucket with the following command:
1$ git push -u origin --all