Difference between revisions of "Using Git Example"

From Genome Analysis Wiki
Jump to navigationJump to search
Line 12: Line 12:
 
# Move into the new repository  
 
# Move into the new repository  
 
# Look at the contents of the bare repository
 
# Look at the contents of the bare repository
# Look at the contents of <code>description</code>
 
# Update <code>description</code> to say: <code>Example Repository for learning to use git.</code>
 
# Look at the updated contents of <code>description</code>
 
  
 
  mkdir -p ~/code/learnGit/bareRepo/
 
  mkdir -p ~/code/learnGit/bareRepo/
Line 21: Line 18:
 
  cd learningGit
 
  cd learningGit
 
  ls
 
  ls
more description
 
echo Example Repository for learning to use git. > description
 
more description
 
  
 
[[Image:CreateNewGitRepository.png]]  
 
[[Image:CreateNewGitRepository.png]]  
  
 
=== Add the first files ===
 
=== Add the first files ===
 +
 +
# Create a working directory
 +
## Move to the appropriate directory
 +
## Clone the initial repository
 +
## Move into the working directory
 +
## Look at the contents
 +
##
 +
cd ~/code/learnGit
 +
git clone ~/code/learnGit/bareRepo/learningGit
 +
cd learningGit
 +
ls -a

Revision as of 20:13, 7 July 2011

Clone Pre Existing Repository

Create a New Repository

Create the Bare Repository

These steps will create a new bare repository called learningGit in ~/code/learnGit/bareRepo/.

  1. Create the containing directory
  2. Go to the correct directory
  3. Create a new bare repository
  4. Move into the new repository
  5. Look at the contents of the bare repository
mkdir -p ~/code/learnGit/bareRepo/
cd ~/code/learnGit/bareRepo/
git init --bare --shared learningGit
cd learningGit
ls

CreateNewGitRepository.png

Add the first files

  1. Create a working directory
    1. Move to the appropriate directory
    2. Clone the initial repository
    3. Move into the working directory
    4. Look at the contents
cd ~/code/learnGit
git clone ~/code/learnGit/bareRepo/learningGit
cd learningGit
ls -a