Skip to content

Instantly share code, notes, and snippets.

@seaseng
Last active December 18, 2015 02:29
Show Gist options
  • Save seaseng/5711797 to your computer and use it in GitHub Desktop.
Save seaseng/5711797 to your computer and use it in GitHub Desktop.

Create a Repository

Go to github and create a repository. Follow the instructions for cloning your repository to your local machine. (Shown below and on github.com everytime you create a new repo.)

For the case of Flashcards 1.0, follow these instructions:

mkdir <your_flashcard_dir>
cd <your_flashcard_dir>
git clone https://gist.github.com/b5e5f90484436f1e7b95.git gist_files   # flashcards gist
mv gist_files/* .

git init
git add .     # adds all the files in your directory to the stage
git commit -m "Added Flashcards File"   # commits your stage to your local repo
git remote add origin https://github.com/<creator-name>/<project-name>.git
git push -u origin master

Use one team member's repo as the single master repo. (Do not each clone your own repos, this will make things much more difficult!)

Add Collaborators

For every team member, follow these instructions for adding a collaborator. Also add the collaborator "dbc-apprentice" since that's the user that all the machines are logged in as.

Set up the other machines

On each machine:

  cd ~/Desktop
  git clone [email protected]:<creator-name>/<project-name>.git

###Adding and Committing

git add .
git commit -m"Added flashcards.txt file"

###Pulling and Pushing

git pull origin master
git push origin master

###Git Status and Log

git status
git log

###The Git Cycle You Need to Know

  1. Add and commit
  2. Pull the master from github
    (git will automagically merge changes unless there is a direct conflict)
  3. Push your integrated local copy back to master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment