Connect with us

Linux

Basics with Bit Bucket

logo

Hi Guys, we will be discussing the basics of commands using the bit bucket! Bitbucket is a famous source control tool. The developers create code and they are uploaded here. We DevOps Engineers use this code for CI/CD or other purposes.

Cloning the Bitbucket to the local machine. By Cloning the repository you will be able to get the code on to the local machine. In this way, you can get the latest code and make changes as desired.

clone-repo

After cloning the repository, it is a best practice that you create your own branch. For this, you will have to follow these steps. Initially checkout from the master or the branch you have already cloned.

Now navigate into the cloned directory

The git status will output the status of the branch. This will state if the branch is up to date or the branch needs to be updated

The above code will create a new branch with the specified name. The code below will list all the available branches in the specific repository.

In order to make changes to the git repository we created, it is needed to checkout to that branch.

Now make the desired changes. Then do a git status so that the changes made will appear. You now need to add the changes to the branch

Git add * is not recommended as it can cause concussions. The best practice is git add with each file name. Again do a git status to see if you have successfully added the files. It will be shown in green.

This will commit the changes, again do a git status and see if the branch is clean and no remaining commits.

This will push the changes to the remote repository.

Continue Reading
Advertisement

Trending