Linux
Basics with Bit Bucket
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.
1 |
git clone git@bitbucket.org:repo_name/directory |
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.
1 |
git checkout |
Now navigate into the cloned directory
1 |
git status |
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
1 |
git branch branch-name |
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.
1 |
git branch |
In order to make changes to the git repository we created, it is needed to checkout to that branch.
1 |
git checkout update branch-name |
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
1 |
git add file_name / git add * |
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.
1 |
git commit -a -m "Commit Message" |
This will commit the changes, again do a git status and see if the branch is clean and no remaining commits.
1 |
git push origin feature-branch-name |
This will push the changes to the remote repository.
-
DevOps55 years ago
Saltstack Tutorial for beginners [2023]
-
DevOps55 years ago
How to build a Docker cron job Container easily [2023]
-
Linux55 years ago
mail Command in Linux/Unix with 10+ Examples [2023]
-
DevOps55 years ago
Docker ADD vs COPY vs VOLUME – [2023]
-
DevOps55 years ago
How to setup Pritunl VPN on AWS to Access Servers
-
Linux55 years ago
Grep Command In Unix/Linux with 25+ Examples [2023]
-
Linux55 years ago
How To setup Django with Postgres, Nginx, and Gunicorn on Ubuntu 20.04
-
Linux55 years ago
Find command in Unix/Linux with 30+ Examples [2023]