Getting Started with Git - OCLC-Developer-Network/devconnect2018-idm GitHub Wiki

  1. We're going to use git to control versioning of our code, and host our code repositories on GitHub. First, create an empty repository on github.com for your code.
    1. Click "New repository"
    2. Title your repository "devconnect_2018_identity-management"
    3. Check the box next to "Initialize this repository with a README"
    4. Click "Create repository"
  2. In a terminal window, change into the following directory:
$ cd /path_to_git_home 

On a Mac this is /Users/{username}/git

  1. Enter this command to clone the repository you just created, substituting your GitHub username for your-github-username:
$ git clone https://github.com/your-github-username/devconnect_2018_identity-management.git
  1. You should now have a subdirectory called devconnect_2018_identity-management with an empty README.md file in it.
$ cd devconnect_2018_identity-management
$ ls
README.md
  1. Next, we're going to run a quick test to make sure you can make updates to your repository.
    1. Open README.md in your text editor.
    2. Make a change - any change - and save it.
    3. Back in your terminal window, run this command:
    $ git status
    You should see output like this:
    On branch master
    Your branch is up-to-date with 'origin/master'.
    Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git checkout -- <file>..." to discard changes in working directory)
    	modified:   README.md
    no changes added to commit (use "git add" and/or "git commit -a")
    1. Now, stage the changes to commit to your repository:
    $ git add --all
    1. Commit the changes:
    $ git commit -m "a message about your commit"
    1. Push the changes to your repository:
    $ git push origin master
    1. In your browser, head back to your GitHub repository at https://github.com/your-github-username/devconnect_2018_identity-management, and you should see the changes you just made to your README file.
⚠️ **GitHub.com Fallback** ⚠️