Wednesday, March 21, 2018

How to add an existing project into bitbucket using command line ?

Let us say you have a project created along with source code. Now you would like to check-in the project into Bitbucket. How will you do it?


1. Make sure Git is installed on that machine.
2. Make sure you add SSH keys to bitbucket.

1. Create a new repo in Bitbucket. Do not create README file yet.
2. Open git bash or command line terminal
3. navigate to your directory where you have source files.
4. run the below command to initialize the  directory as local repository.
       git init
5. Execute git add .
6. git commit -m "my project setup in bitbucket"
7. git remote add origin remote repository URL
8. git push -u origin master

Now login to Bitbucket and make sure code is available under Source tab for the repo.

No comments:

Post a Comment