{"id":877,"date":"2015-05-07T16:45:20","date_gmt":"2015-05-07T16:45:20","guid":{"rendered":"http:\/\/codethataint.com\/blog\/?p=877"},"modified":"2019-03-16T17:44:33","modified_gmt":"2019-03-16T17:44:33","slug":"creating-git-repository-and-source-control","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/creating-git-repository-and-source-control\/","title":{"rendered":"Creating Git Repository and Source Control"},"content":{"rendered":"<p><strong>Step 1<\/strong>: Initialize the Working Directory.This is the working Directory where your project resides<\/p>\n<pre>\r\n [cloudera@localhost MapReduce]$ git init\r\n<\/pre>\n<p><strong>Step 2<\/strong>: Add to the Staging Directory as below<\/p>\n<pre>\r\n [cloudera@localhost MapReduce1]$ git add *\r\n<\/pre>\n<p><strong>Step 3<\/strong>: Commit to the Local Repository<\/p>\n<pre>\r\n[cloudera@localhost MapReduce1]$ git commit -am \"Initial Commit\"\r\n<\/pre>\n<p><strong>Step 4<\/strong>: Run this on Terminal to Generate SSH Key<\/p>\n<pre>\r\nssh-keygen -t rsa -C \"mugil.cse@gmail.com\" \r\n<\/pre>\n<p><strong>Step 5<\/strong>: Generated SSH Key will be in Users home Directory.It contains both private and Public key<\/p>\n<pre>\r\ncd \/home\/cloudera\/.ssh\r\n<\/pre>\n<pre>\r\n[cloudera@localhost .ssh]$ ll\r\ntotal 12\r\n-rw------- 1 cloudera cloudera 1671 May  7 21:11 id_rsa\r\n-rw-r--r-- 1 cloudera cloudera  401 May  7 21:11 id_rsa.pub\r\n-rw-rw-r-- 1 cloudera cloudera  395 May  7 21:01 known_hosts\r\n<\/pre>\n<p><em>id_rsa<\/em> contains the private key and <em>id_rsa.pub<\/em> contains the public key.The Public key is added to the main repository where all the files are pushed at the day end.The public key and private key are verified by some algorithm every time a connection is made.The private key can be shared to user to  whom  limited  access to repository should be given rather than using email adderess as password.<\/p>\n<p><strong>Step 6 :<\/strong> Open the id_rsa.pub which contains the public key which need to be added to the Repository<\/p>\n<pre>\r\n[cloudera@localhost .ssh]$ cat id_rsa.pub \r\nssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAymFMhm8XM8NzuGMNrBzybMhdwkFZtWGSqo2zwkS4tWQGKQDLODD9tV+gXZeqiGWh\/JkVq6P+QvwsMdl5kOTg+M33UDtP\/dydUQ+eWNE0HoKRypldS5qvUtt\/Y0+rOg\/cy3U2tN4EWaY3oer0lFEY+esOc2tAogUcqCuyN37ywLB6wa23XKxgPFNpgxGM+rf3r2gVbV81hdHJ7RSTVpsS\/BaetZZlvFAgNSo2qbVJlhpTY\/GrF1Nhtz3q8oGfoxsUGtU+12JFJXphRQnYO0EJhZLxYSZvIcqb5YWmUZLVOg+HTsncnH1T5\/l9tx\/AT6IjqIo5ZbV+NxQ6R2F4fD0wEQ== mugil@gmail.com\r\n<\/pre>\n<p><strong>Step 7<\/strong>: Paste the Git Repository URL as below <\/p>\n<pre>\r\n[cloudera@localhost MapReduce]$ git remote add origin git@bitbucket.org:Mugil\/hadoop.git\r\n<\/pre>\n<p><strong>Step 8<\/strong>: Now we need to Push the Staged File.<\/p>\n<pre>\r\n[cloudera@localhost MapReduce]$ git push origin master\r\n<\/pre>\n<p>Some Times while Pushing it might return back message like below<\/p>\n<p><em>conq: repository access denied. deployment key is not associated with the requested repository. fatal: The remote end hung up unexpectedly<\/em><\/p>\n<p>For that use<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n ssh-add ~\/.ssh\/id_rsa\r\n<\/pre>\n<p>This Forces the Location of the private key to be set at global level in the System.<\/p>\n<p><strong>Checking SSH Status<\/strong><\/p>\n<pre>\r\n>>service sshd status\r\n>>service sshd start\r\n>>chkconfig sshd on\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Step 1: Initialize the Working Directory.This is the working Directory where your project resides [cloudera@localhost MapReduce]$ git init Step 2: Add to the Staging Directory as below [cloudera@localhost MapReduce1]$ git add * Step 3: Commit to the Local Repository [cloudera@localhost MapReduce1]$ git commit -am &#8220;Initial Commit&#8221; Step 4: Run this on Terminal to Generate SSH&hellip; <a href=\"https:\/\/codethataint.com\/blog\/creating-git-repository-and-source-control\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[163],"tags":[],"class_list":["post-877","post","type-post","status-publish","format-standard","hentry","category-git"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/877","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=877"}],"version-history":[{"count":7,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/877\/revisions"}],"predecessor-version":[{"id":1354,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/877\/revisions\/1354"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=877"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=877"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}