Skip to content

Latest commit

 

History

History
115 lines (60 loc) · 4.29 KB

13.md

File metadata and controls

115 lines (60 loc) · 4.29 KB
date draft weight title
2016-05-09
false
13
Lab 13 - Git
Mon Mon Mon Mon Tue Tue Tue Tue Wed Wed Wed Thur Thur Thur Thur
00 01 02 03 04 05 06 07 08 09 10 11 12 alt text 14

Lab Duration: 20 minutes

Lab Objective

The objective of this lab is to give students a basic introduction to git and git pull requests. Many open source projects rely on git for decentralized collaboration including OpenStack.

1. Setup Github Account (You are advised to use a personal email address for this!)

  1. In a new tab, Create a Github account or Login

    Create an account

  2. Navigate to the Alta3 OpenStack Glossary project by pasting the following URL into a new tab within your browser.

    https://github.com/alta3/openstack-labs

  3. Star the repository

    Star this repository

    Staring is like a bookmark on github.com, you can view and search your stared repositories at github.com/stars

2. Fork the lab repository

  1. Fork the lab repository into your account

    Fork this repository

    Fork this repository

    Fork this repository

3. Set up your controller

  1. SSH to your controller as root

    [root@controller ~]# mkdir ~/myopenstack

    [root@controller ~]# cd ~/myopenstack

    [root@controller myopenstack]# yum install git

    [root@controller myopenstack]# git config --global user.name "--- Place your name here ---"

    [root@controller myopenstack]#``git config --global user.email "[email protected]"

    [root@controller myopenstack]# git config --list

    [root@controller myopenstack]# git init

  2. Create a history file, and push it up to GitHub.

    [root@controller myopenstack]# history > history

    [root@controller myopenstack]# git add history

    [root@controller myopenstack]# git status

    [root@controller myopenstack]# git commit -m 'This is supposed to add my history to my repository'

4. CREATE REPOSITORY on your github account called 'myopenstack'

  1. From the homepage of your github account, click #1 on +, then click #2 the New Repository from the dropdown. If you are NOT logged in, you will NOT see this option! Create New Repository

  2. On your github account, create your new repository called "myopenstack".

    Create New Repository

  3. On your github account, discover your remote URL and record it.

    Discover Repository URL

  4. At your controller SSH sesssion, link your ~/myopenstack directory to the repository you just created.

    [root@controller myopenstack]# git remote add origin https://github.com/YOUR-ACCOUNT-NAME-HERE/myopenstack.git

    [root@controller myopenstack]# git push origin master

    [root@controller myopenstack]# # respond to login
    [root@controller myopenstack]# # respond to password

  5. If (and only if) the above step fails, most likely your github repository is out of sync or the remote target is incorrect. Try to resolve the issue as follows:

    Let's make sure we have the correct target!

    [root@controller myopenstack]# git remote rm origin

    [root@controller myopenstack]# git remote add origin https://github.com/YOUR-ACCOUNT-NAME-HERE/myopenstack.git

    Pull down new files on the github repo in order to synchonize with the master branch.

    [root@controller myopenstack]# git pull origin master

    This will sync github with your current directly

    [root@controller myopenstack]# git push origin master

    Now that you are synced with github, this should work