private-git-server public repository public_html / 9e846ed
Update lanuage syntax highlighting Shakiba Moshiri 10 months ago
1 changed file(s) with 16 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
33 <p>Github is a company that runs servers to manage software source code using <strong>git</strong> tool.</p>
44 <p>It has <strong>free</strong> public repositories and <strong>non-free</strong> private repositories.</p>
55 <p>With github we do this where the domain name is <strong>github.com</strong>:</p>
6 <pre><code class="language-javascript">// clone a repository
6 <pre><code class="language-bash"># clone a repository
77 git clone [email protected]/k-five/private-git-server
8 // or
8 # or
99 git remote add origin [email protected]/k-five/private-git-server
1010
1111
12 // for push
12 # for push
1313 git push -u origin master
1414
15 // git remote -v
15 # git remote -v
1616 origin [email protected]/k-five/private-git-server.git (fetch)
1717 origin [email protected]/k-five/private-git-server.git (push)</code></pre>
1818
2020 <p>Gitlab is the same somehow.</p>
2121 <p>It offers both <strong>public</strong> and <strong>private</strong> repositories for free.</p>
2222 <p>With gitlab we do this where the domain name is <strong>gitlab.com</strong></p>
23 <pre><code class="language-javascript">// clone a repository
23 <pre><code class="language-bash"># clone a repository
2424 git clone [email protected]/k-five/private-git-server
25 // or
25 # or
2626 git remote add origin [email protected]/k-five/private-git-server
2727
28 // for push
28 # for push
2929 git push -u origin master
3030
31 // git remote -v
31 # git remote -v
3232 origin [email protected]/k-five/private-git-server.git (fetch)
3333 origin [email protected]/k-five/private-git-server.git (push)</code></pre>
3434
3636 <p>Private git server will be our own server that uses <strong>git</strong> tool as our version control system.</p>
3737 <p>Although it is possible to have <a target="_blank" href="http://private-git-server.ir/code/">public repositories with a private-git-server</a>, but the main purpose is to have private repositories.</p>
3838 <p>With our server we do this where the domain name is our own at <strong>private-git-server.ir</strong></p>
39 <pre><code class="language-javascript">// clone a repository
39 <pre><code class="language-bash"># clone a repository
4040 git clone [email protected]:private-git-server.git
41 // or
41 # or
4242 git remote add origin [email protected]:private-git-server.git
4343
44 // for push
44 # for push
4545 git push -u origin master
4646
47 // git remote -v
48 // for our private git server
47 # git remote -v
48 # for our private git server
4949 origin [email protected]:private-git-server.git (fetch)
5050 origin [email protected]:private-git-server.git (push)</code></pre>
5151
5252 <p>It is not accessible to outside world unless we have access to the server using SSH.</p>
5353 <p>But for testing purposes your can clone it using <strong>git</strong> protocol.</p>
54 <pre><code class="language-javascript">// test if the repository is available
54 <pre><code class="language-bash"># test if the repository is available
5555 git ls-remote git://95.216.12.6/private-git-server
5656 5050fde5f52330592fc6a84c83b0fa6149b02026 HEAD
5757 5050fde5f52330592fc6a84c83b0fa6149b02026 refs/heads/master
5858
59 // clone the repository
60 // this is publicly available just for TEST
59 # clone the repository
60 # this is publicly available just for TEST
6161 git clone git://95.216.12.6/private-git-server
6262 Cloning into 'private-git-server'...
6363 remote: Counting objects: 112, done.