Bitbucket is a web-based version control repository hosting service owned by Atlassian, primarily used for source code and development projects that use Git revision control systems.
Create an Account: Visit bitbucket.org and sign up for a new account.
Create a New Repository:
Clone the Repository:
git clone https://yourusername@bitbucket.org/yourusername/your-repo.git
Set Up SSH Key (Optional but Recommended):
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Add Files:
git add filename
git add . # Adds all files
Commit Changes:
git commit -m "Your commit message"
Push Changes:
git push origin main
Pull Changes:
git pull origin main
Check Status:
git status
View Commit History:
git log
Create a New Branch:
git branch new-feature
git checkout -b new-feature # Creates and switches to the new branch
Switch Branches:
git checkout branch-name
Merge Branches:
git checkout main
git merge new-feature
Delete a Branch:
git branch -d branch-name # Local deletion
git push origin --delete branch-name # Remote deletion
Create a Pull Request:
Review a Pull Request:
Merge a Pull Request:
Create an Issue:
Manage Issues:
Link Issues to Commits: In your commit message, reference the issue:
git commit -m "Fix login bug (fixes #123)"
Enable Pipelines:
Create bitbucket-pipelines.yml:
pipelines:
default:
- step:
name: Build and Test
script:
- npm install
- npm test
View Pipeline Results:
Authentication: Use App passwords or OAuth for API authentication
Example API Request (Using curl):
curl -u username:app_password -X GET https://api.bitbucket.org/2.0/repositories/username/repo_slug
Webhook Setup:
Snippets: Share code snippets with your team
Forks: Create a copy of a repository to propose changes
Bitbucket Cloud vs Server: Choose between cloud-hosted and self-hosted options
Integrations: Connect with tools like Jira, Trello, and Slack
Use Meaningful Commit Messages:
git commit -m "Add user authentication feature"
Regular Pulls and Pushes: Keep your local repository up-to-date and push changes frequently
Branch Naming Conventions: Use prefixes like feature/, bugfix/, hotfix/
Code Review: Always have at least one reviewer for pull requests
Keep Repositories Clean: Use .gitignore to exclude unnecessary files
Use Tags for Releases:
git tag -a v1.0 -m "Version 1.0 release"
git push origin v1.0
Backup Your Repositories: Regularly clone or mirror your repositories for backup
2024 © All rights reserved - buraxta.com