3 BitbucketGit
3 BitbucketGit
1. Creating a Repository
2. Cloning a Repository
a. Use git clone <repository_url> with the URL you copied from
Bitbucket.
3. Making Changes and Creating a Branch
a. Navigate into the cloned repository
b. Create a new text file named "filename.txt" using a text editor.
c. Add some content to the " filename.txt" file.
d. Save the file and return to the command line.
e. Check the status of the repository
f. Stage the changes for commit
g. Commit the changes with a descriptive message
"Edited_example.txt"
h. Create a new branch named "feature"
i. Switch to the "feature" branch
j. Pushing Changes to Bitbucket
4. Pushing Changes to Bitbucket
a. Add Repository URL in a variable
b. Replace <repository_url> with the URL you copied from Bitbucket
c. Push the "feature" branch to Bitbucket
d. Check your Bitbucket repository to confirm that the new branch
"feature" is available.
5. Collaborating through Pull Requests
a. Create a pull request on Bitbucket:
i. Go to the repository on Bitbucket.
ii. Click on "Create pull request."
iii. Choose the source branch ("feature") and the target branch
("main" or
iv. "master").
v. Review the changes and click "Create pull request."
b. Review and merge the pull request:
i. Add a title and description for the pull request.
ii. Assign reviewers if needed.
iii. Once the pull request is approved, merge it into the target
branch.
6. Syncing Changes
a. After the pull request is merged, update your local repository