← Back to Git Course | Chapter 4: Remote Repositories | Lesson 9 of 11

Git Bitbucket Introduction

Bitbucket आपके Git projects online रखने की एक और जगह है, एक अलग clubhouse जैसी जो Jira task board के साथ खासतौर पर अच्छी तरह काम करती है।
Syntax
bash
git remote add origin https://bitbucket.org/user/repo.git
git clone https://bitbucket.org/user/repo.git

Bitbucket क्या है?

Bitbucket Atlassian की Git hosting service है, मुख्य रूप से issue tracking के लिए Jira और documentation के लिए Confluence के साथ अपने tight native integration के लिए जानी जाती है -- आप इसे एक local repository से exactly GitHub या GitLab जैसे ही एक remote की तरह connect करते हैं।

उदाहरण: What is Bitbucket?

bash
git remote add origin https://bitbucket.org/user/repo.git

Bitbucket से Clone करना

Bitbucket से clone करना किसी दूसरे host जैसा ही काम करता है: repository page से HTTPS या SSH URL लें और git clone <url> चलाएँ, और Git automatically origin remote configure कर देता है।

उदाहरण: Cloning from Bitbucket

bash
git clone https://bitbucket.org/user/repo.git

Remotes Manage करना

अगर किसी Bitbucket repository का URL बदलता है -- मान लीजिए, एक workspace rename के बाद -- git remote set-url origin <new-url> किसी local history को disturb किए बिना इसे update करता है; remote को खुद rename करना एक अलग, optional step है।

उदाहरण: Managing Remotes

bash
git remote set-url origin https://bitbucket.org/newworkspace/repo.git

Bitbucket Pipelines के साथ काम करना

Bitbucket Pipelines Atlassian का built-in CI/CD tool है, जो आपकी repository में committed एक bitbucket-pipelines.yml file के through configure होता है, आपको automated test और build steps define करने देते हुए जो हर push पर चलते हैं।

उदाहरण: Working with Bitbucket Pipelines

bash
echo "pipelines:\n  default:\n    - step:\n        script:\n          - npm test" > bitbucket-pipelines.yml

SSH Keys Set Up करना

SSH keys आपको हर push या pull पर password type किए बिना Bitbucket में authenticate करने देती हैं -- एक बार आप अपने Bitbucket account में अपनी public key add कर दें, ssh -T [email protected] confirm करता है कि connection सही से काम कर रहा है।

उदाहरण: Setting Up SSH Keys

bash
ssh -T [email protected]
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the view already swaps in the hi_ translation fields (or blanks these out if untranslated), so this renders correctly for both languages without a lang_code check here. #}
आम गलतियां
  1. किसी दूसरे host या workspace से copy किए गए URL से clone करना, ताकि git clone एक not-found या authentication error से fail हो।
  2. पहले से origin exist करते हुए git remote add origin ... से एक remote add करना, इसे git remote set-url origin <new-url> से update करने के बजाय।
  3. HTTPS पर अपना Bitbucket account password enter करना, जबकि इसे एक app password या access token चाहिए।

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.