User Tools

Site Tools


vcs:git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
vcs:git [2021/01/19 10:02] – [Bare Git Repository in your CS Home directory] kauffmanvcs:git [2021/09/22 17:19] (current) ctopper
Line 1: Line 1:
 ====== Git ====== ====== Git ======
 A collection of resources. A collection of resources.
 +
 +  * [[https://rev.cs.uchicago.edu|rev.cs.uchicago.edu]]: For faculty and staff. Sign in and then email techstaff to get your project quota raised from 0. You won't be able to use this server until your quota is raised.
 +
  
  
 ===== External Guides ===== ===== External Guides =====
   * [[https://www.atlassian.com/git/tutorials/what-is-version-control|How to Git]]   * [[https://www.atlassian.com/git/tutorials/what-is-version-control|How to Git]]
 +  * [[http://rogerdudler.github.io/git-guide/|git - the simple guide]]
  
  
Line 20: Line 24:
 Note that a bare repo cannot be edited directly. You will need to checkout the repository elsewhere in your home directory. Note that a bare repo cannot be edited directly. You will need to checkout the repository elsewhere in your home directory.
 <code> <code>
-$ mkdir $HOME/myproject.git +$ mkdir $HOME/gitbare/myproject.git 
-$ cd $HOME/myproject.git+$ cd $HOME/gitbare/myproject.git
 $ git init --bare --shared $ git init --bare --shared
 </code> </code>
Line 29: Line 33:
 Even if you are on one of the linux.cs servers you will need to checkout the bare repo. Even if you are on one of the linux.cs servers you will need to checkout the bare repo.
 <code> <code>
-git clone cnetid@linux.cs.uchicago.edu:~/myproject.git+git clone cnetid@linux.cs.uchicago.edu:~/gitbare/myproject.git 
 +</code> 
 + 
 +==== Example ==== 
 +<code> 
 +laptop:~$ ssh kauffman3@linux.cs.uchicago.edu 
 +kauffman3@linux3:~$ mkdir myproject.git 
 +kauffman3@linux3:~$ cd myproject.git/ 
 +kauffman3@linux3:~/gitbare/myproject.git$ git init --bare --shared 
 +Initialized empty shared Git repository in /home/kauffman3/gitbare/myproject.git/ 
 +kauffman3@linux3:~/gitbare/myproject.git$ cd 
 +</code> 
 + 
 +=== Clone from inside your CS home === 
 +<code> 
 +kauffman3@linux3:~$ git clone kauffman3@linux.cs.uchicago.edu:~/gitbare/myproject.git 
 +Cloning into 'myproject'... 
 +kauffman3@linux.cs.uchicago.edu's password:  
 +warning: You appear to have cloned an empty repository. 
 + 
 +kauffman3@linux3:~$ cd ~/myproject 
 +kauffman3@linux3:~/gitbare/myproject$ touch README 
 +kauffman3@linux3:~/myproject$ git add README  
 +kauffman3@linux3:~/myproject$ git commit -a 
 +[master (root-commit) b549cd7] add readme 
 + Committer: kauffman3 <kauffman3@linux3.cs.uchicago.edu> 
 + 1 file changed, 0 insertions(+), 0 deletions(-) 
 + create mode 100644 README 
 + 
 +kauffman3@linux3:~/myproject$ git push 
 +kauffman3@linux.cs.uchicago.edu's password:  
 +Enumerating objects: 3, done. 
 +Counting objects: 100% (3/3), done. 
 +Writing objects: 100% (3/3), 212 bytes | 212.00 KiB/s, done. 
 +Total 3 (delta 0), reused 0 (delta 0) 
 +To linux.cs.uchicago.edu:~/myproject.git 
 + * [new branch]      master -> master 
 +</code> 
 + 
 +=== Clone from your laptop or elsewhere === 
 + 
 +<code> 
 +laptop:~$ git clone kauffman3@linux.cs.uchicago.edu:~/myproject.git 
 +Cloning into 'myproject'... 
 +kauffman3@linux.cs.uchicago.edu's password:  
 +remote: Enumerating objects: 3, done. 
 +remote: Counting objects: 100% (3/3), done. 
 +remote: Total 3 (delta 0), reused 0 (delta 0) 
 +Receiving objects: 100% (3/3), done. 
 + 
 +laptop:~$ ls -l myproject/ 
 +total 0 
 +-rw-rw-r-- 1 kauffman kauffman 0 Jan 19 10:11 README
 </code> </code>
  
  
/var/lib/dokuwiki/data/attic/vcs/git.1611072132.txt.gz · Last modified: 2021/01/19 10:02 by kauffman

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki