{"id":16742,"date":"2022-04-22T19:55:27","date_gmt":"2022-04-22T19:55:27","guid":{"rendered":"https:\/\/linuxways.net\/?p=16742"},"modified":"2022-04-22T19:55:27","modified_gmt":"2022-04-22T19:55:27","slug":"how-to-configure-a-remote-git-repo-on-debian-11","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/debian\/how-to-configure-a-remote-git-repo-on-debian-11\/","title":{"rendered":"How to Configure a Remote Git Repo on Debian 11"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>Today we are going to discuss how to configure and manage a Bitbucket repo on Debian 11 server. I am using Debian 11 server edition for this guide, and I\u2019ll make sure that all commands are readily available for all related systems except Fedora. The main reason that you should not implement instructions on a Red Hat systems is to avoid any configuration mistakes and dependency issues.<\/p>\n<h2>What are Git and BitBucket exactly?<\/h2>\n<p>The simplest answer, for now, is that Git is a version control system to manage files remotely and keep track of all the changes. Unlike Git, BitbBucket is a platform that helps to keep those files on the server. BitBucket has both self-hosted and cloud options, but we are only going to use the cloud version which is freely available for a team of up to 5 users.<\/p>\n<p>I will keep exploring Git and BitBucket separately in future articles. For the latest tips and tricks keep visiting linuxways.net regularly.<\/p>\n<h2>First things first<\/h2>\n<p>As always we should make sure that the Git is available on your system. I\u2019ll run the following command to make sure that I have the latest stable version of Git on my Debian 11 server.<\/p>\n<pre><strong>$ git --version<\/strong><\/pre>\n<p>The command will display your latest available git version. In my case, it is 2.25.1 as shown below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"307\" height=\"51\" class=\"wp-image-16743\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-180.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-180.png 307w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-180-300x50.png 300w\" sizes=\"auto, (max-width: 307px) 100vw, 307px\" \/><\/p>\n<h2>Connect and Configure Bitbucket<\/h2>\n<p><strong>Step 1.<\/strong> Now we will proceed to connect and configure the Bitbucket cloud. Visit bitbucket.org and get it for free.<\/p>\n<p>You will have a similar dashboard as below once signed up successfully:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1331\" height=\"646\" class=\"wp-image-16744\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-181.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-181.png 1331w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-181-300x146.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-181-1024x497.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-181-768x373.png 768w\" sizes=\"auto, (max-width: 1331px) 100vw, 1331px\" \/><\/p>\n<p><strong>Step 2:<\/strong> We\u2019ll then create a repository in our BitBucket cloud.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"540\" height=\"359\" class=\"wp-image-16745\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-182.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-182.png 540w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-182-300x199.png 300w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><\/p>\n<p><strong>Step 3.<\/strong> Once a repository is created, we will go to repository settings to connect with BitBucket locally.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"225\" height=\"456\" class=\"wp-image-16746\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-183.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-183.png 225w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-183-148x300.png 148w\" sizes=\"auto, (max-width: 225px) 100vw, 225px\" \/><\/p>\n<p><strong>Step 4.<\/strong> First clone the repository using the clone link which you will find on the top right of the project page.<\/p>\n<p>In our case, the git command will be:<\/p>\n<pre><strong>$ git clone https:\/\/username@bitbucket.org\/username\/reponame.git<\/strong><\/pre>\n<p>You must update the <strong>username<\/strong> and <strong>reponame<\/strong> to match with yours.<\/p>\n<p>The whole scenario will go similar to the following:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"683\" height=\"130\" class=\"wp-image-16747\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-184.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-184.png 683w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-184-300x57.png 300w\" sizes=\"auto, (max-width: 683px) 100vw, 683px\" \/><\/p>\n<p>Now type the following command to list your fetched directory on your system<\/p>\n<pre><strong>$ ls<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"259\" height=\"50\" class=\"wp-image-16748\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-185.png\" \/><\/p>\n<p><strong>Step 5.<\/strong> Now we\u2019ll go to our repository folder, create a new file, and push it to the origin which is Bitbucket.<\/p>\n<p>1. Type the following command to change the directory<\/p>\n<pre><strong> $ cd<\/strong><\/pre>\n<p>2. Now create a new file using the following command<\/p>\n<pre><strong> $ touch update.md<\/strong><\/pre>\n<p>3. We\u2019ll edit the file in nano as shown below<\/p>\n<pre><strong> $ nano update.md<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"371\" height=\"52\" class=\"wp-image-16749\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-186.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-186.png 371w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-186-300x42.png 300w\" sizes=\"auto, (max-width: 371px) 100vw, 371px\" \/> <\/strong><\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"745\" height=\"601\" class=\"wp-image-16750\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-187.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-187.png 745w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-187-300x242.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/04\/word-image-187-150x120.png 150w\" sizes=\"auto, (max-width: 745px) 100vw, 745px\" \/><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>4. Once saved we\u2019ll push our changes to the Bitbucket repository using the following commands.<\/p>\n<pre><strong> $ git add *<\/strong><\/pre>\n<pre><strong> $ git commit -m \u201cupdate\u201d<\/strong><\/pre>\n<pre><strong> $ git push origin master<\/strong><\/pre>\n<p>These will push all the changes to our Bitbucket repository.<\/p>\n<h2>Conclusion<\/h2>\n<p>In this tutorial, we learned how to create a repository on Bitbucket, fetch it, modify, and push it locally. We also used some other software like nano editor. There are many more tricks and tips available on LinuxWays for advanced understanding of Git and related Linux software. If you have any questions then submit your questions, and we\u2019ll be happy to help you.<\/p>","protected":false},"excerpt":{"rendered":"<p>Introduction Today we are going to discuss how to configure and manage a Bitbucket repo on Debian 11 server. I am using Debian 11 server edition for this&hellip;<\/p>","protected":false},"author":1,"featured_media":16796,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[521,475],"class_list":["post-16742","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian","tag-debian-11","tag-git"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/16742","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=16742"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/16742\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/16796"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=16742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=16742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=16742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}