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 | 14 |
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.
-
In a new tab, Create a Github account or Login
-
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
-
Star the repository
Staring is like a bookmark on github.com, you can view and search your stared repositories at github.com/stars
-
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
-
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'
-
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!
-
On your github account, create your new repository called "myopenstack".
-
On your github account, discover your remote URL and record it.
-
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
-
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