Getting Started with Git - OCLC-Developer-Network/devconnect2018-idm GitHub Wiki
- 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.
- Click "New repository"
- Title your repository "devconnect_2018_identity-management"
- Check the box next to "Initialize this repository with a README"
- Click "Create repository"
- In a terminal window, change into the following directory:
$ cd /path_to_git_home On a Mac this is /Users/{username}/git
- 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- You should now have a subdirectory called
devconnect_2018_identity-managementwith an empty README.md file in it.
$ cd devconnect_2018_identity-management
$ ls
README.md- Next, we're going to run a quick test to make sure you can make updates to your repository.
- Open README.md in your text editor.
- Make a change - any change - and save it.
- Back in your terminal window, run this command:
You should see output like this:$ git status
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")
- Now, stage the changes to commit to your repository:
$ git add --all
- Commit the changes:
$ git commit -m "a message about your commit"- Push the changes to your repository:
$ git push origin master
- 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.