Git repository with Bitbucket Cloud

As our new Bitbucket space station administrator, you need to be organized. When you make files for your space station, you’ll want to keep them in one place and shareable with teammates, no matter where they are in the universe.



Steps :

1. Create an account with bitbucket.

2. Create a Git repository : Initially, the repository you create in Bitbucket is going to be empty without any code in it.That‘s okay because you will start adding some files to it soon.This Bitbucket repository will be the central repository for your files, you can manage your repository public or private use.

Steps for create your repository.

click Repositories > Create repository button at the top of the page.



Then fill the detail repository name and description etc.I'm creating a test repo. Then after creating the repository.

3. Set up your local directory.




mkdir /path/to/your/project
cd /path/to/your/project
git init
git remote add origin git@bitbucket.org:xyz/test.git


4. Create your first file, commit, and push


echo "First commit" >> contributors.txt
git add contributors.txt
git commit -m 'Initial commit with contributors'
git push -u origin master

This will create a repo on your machine and push it over the bitbucket using git@bitbucket.org:xyz/test.git remote address.

5. Already have a Git repository on your computer? Let's push it up to Bitbucket.


cd /path/to/my/repo
git remote add origin git@bitbucket.org:xyz/test.git
git push -u origin --all # pushes up the repo and its refs for the first time
git push origin --tags # pushes up any tags

Now everything is setup on remote repo. Now you can modify your files and work with remote changes.

No comments:

Post a Comment

Download the eBook of react js for beginners

ReactJS basically is an open-source JavaScript library which is used for building user interfaces specifically for single page applications...

Popular