🔴 FREE LIVE WEBINAR
How to Become a DevOps Engineer in 2027
From Zero to DevOps Champion!
November 21st, 2026 | 9:30 AM CST
Live DevSecOps CI/CD Demo
Career Roadmap • Live Q&A
🚀 REGISTER FOR FREE
🚀 NEW WEEKEND BATCH
AI-Enabled DevSecOps & Cloud Engineering Bootcamp
Starts December 5th, 2026
Sat: 9:30 AM – 11:30 AM CST
Sun: 10:30 AM – 12:30 PM CST
15 Weeks • 70+ Labs • Live Training
EXPLORE BOOTCAMP →
3,500+
Students Trained
25+
Years of IT Experience
70+
Hands-On Labs
🔴 FREE Webinar | Nov 21 Register Free
🚀 New Batch | Dec 5 Explore Bootcamp
🎁 FREE Career Roadmap Get Roadmap

Friday, February 8, 2019

Connect EC2 instance to Git Repo - How to connect EC2 instance to BitBucket

Let us see steps for connecting an EC2 instance to Git repo such as BitBucket.

1. Create SSH keys in EC2 instance first by executing below command:

ssh-keygen
(no need to give any password)

The above command will create two keys - public key(is_rsa.pub) and private key(is_rsa)

2. Copy public keys from .ssh folder

sudo cat ~/.ssh/id_rsa.pub

3. Now go to Bitbucket, click on avatar and click on Bitbucket Settings.
 4. Click on Add Key and copy the content of public keys


5. Now click on repo you want to make a code change. Click on Clone and copy the SSH url. Do not select HTTPS Url. The url will be from your repo you created under Clone link.


6. Go to your EC2, perform below command:

git clone <ssh_url_from_bitbucket_repo_you_copied>

7. Click yes to connect

8. Now you will see a folder with reponame created.

9. You can cd into reponame and make some code changes..once you make a code change, you can commit into Bitbucket by entering below comments

10. git add *

11. got commit -m "My first commit" 

12. git push

Now go to Bitbucket refresh you will see the code changes in BitBucket.

No comments:

Post a Comment

FREE LIVE WEBINAR | How to Become a DevOps Engineer in 2027

 🚀 Your Future in DevOps Starts Here! New Skills. New Opportunities. A New Career Direction. The world of technology is evolving faste...