Skip to content

Instantly share code, notes, and snippets.

@thelmuth
Created January 20, 2012 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thelmuth/1648038 to your computer and use it in GitHub Desktop.
Save thelmuth/1648038 to your computer and use it in GitHub Desktop.
Instructions for initializing a group Git project for the CI Lab.

Initializing A Git Project

  1. Write some code you want to make into a Git project.

  2. Change to the root directory of the project.

     $ cd project
    
  3. Initialize a Git repository.

     $ git init
    
  4. (optional) Add a .gitignore file. This file contains regular expressions of files to ignore when committing. For example:

     $ echo "*~" > .gitignore
    
  5. (optional) Add a README file. This will be displayed on the GitHub main project page.

  6. Add all files in your project.

     $ git add .
    
  7. Commit your project.

     $ git commit -m "Initialization of project"
    
  8. Sign into GitHub and click New Repository.

  9. Fill in project information and click Create Repository.

  10. Add your GitHub repository as "origin". Note: use the location given to you by GitHub.

    $ git remote add origin git@github.com:username/projectname.git
    
  11. Push your project to GitHub.

    $ git push origin master
    
  12. Create a working branch to do your work on.

    $ git branch working
    $ git checkout working
    
  13. Add contributors as others who may want to contribute. Go to the project's page on GitHub, click Admin, then Collaborators, and then add GitHub usernames.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment