-
cd
into the universe folder and open the directory in sublime as well.cd ~/Development/universe subl ~/Development/universe
-
Run
git status
to make sure the repository is "clean" (i.e. there are no "untracked files", "unstaged changes", or "staged changes"). -
Run
git pull
to ensure you have the latest changes in the repository. -
Create a branch called
blue-universe
.- Modify the facts in
mars.txt
to add a new line "Mars is blue". Usegit diff
to ensure that you only modified that one line and nothing else. - Commit this change to the branch.
- Push the branch.
- Create a pull request but do not merge it.
- Modify the facts in
-
Check out the master branch and then create a new branch called
red-universe
.- Modify the facts in
mars.txt
to add a new line "Mars is red". Usegit diff
to ensure that you only modified that one line and nothing else. - Commit this change to the branch.
- Push the branch.
- Create a pull request but do not merge it.
- Modify the facts in
-
Merge the
red-universe
pull request. Try to merge theblue-universe
pull request and it should say the branch cannot be automatically merged. This mean's there is a merge conflict. -
Create a branch called
the-upside-down
.- Edit
united_states.txt
with the text: "Hawkins, Indiana: The Demogorgon was here." - Commit this change to the branch.
- Push the branch.
- Do not merge this branch back in as the upside down runs parallel to the real
universe
...
- Edit
-
Make sure the repository is clean and you are in the master branch.
-
Create a branch called
alternative-facts
. -
Go back to the
master
branch.git checkout master
- Add two facts to
mars.txt
: "Mars has polar ice caps." and "Mars is a little more than half the size of earth." - Commit these changes to
master
.
-
Go back to the
alternative-facts
branch.git checkout alternative-facts
- Add two facts to
mars.txt
. "Mars is gaseous." and "Mars is double the size of earth." - Commit these changes to
alternative-facts
. - Create a pull request using
alternative-facts
.
-
Attempt to merge the pull request and try to resolve the merge conflicts.
-
Get into your teams.
-
The product owner should:
- create a repository under their account named
demo-website
- add the remaining team members as collaborators to the repo. this is done under the repo settings
- enable github pages on this repo with the
master
branch as the source
- create a repository under their account named
-
Everyone should clone the empty repository.
git clone [email protected]:XXXXX/demo-website.git
-
The product owner should create an
index.html
and a an empty folder calledour-team
. Commit and push this change directly to themaster
branch. Here is a sampleindex.html
:<!DOCTYPE html> <html> <body> <h1>Demo Website</h1> </body> </html>
-
Everyone else should pull these changes.
git pull
-
All team members, should create branches titled
add-member-<name>
.For example a team might have
add-member-rachel
,add-member-monica
,add-member-phoebe
, etc. -
In this branch, each team member should create a file that is titled
our-team/<name>.html
. For example, I would createour-team/dhrumil.html
. Add some basic information about yourself to this page. Be sure to only create this one file - there should be no other changes to the repository. It's important to keep your code changes isolated when working with git to avoid unecessary merge conflicts.- Each member should:
- commit this change to the branch
- push it
- create a pull request
- Product owner should review and merge all of the PRs. There should be no conflicts.
- Each member should:
-
The product owner should create links to each of these individal pages back into the
index.html
.<!DOCTYPE html> <html> <body> <h1>Our Website</h1> <ul> <li><a href="our-team/rachel.html">Rachel</a></li> <li><a href="our-team/monica.html">Monica</a></li> <li><a href="our-team/phoebe.html">Phoebe</a></li> <li><a href="our-team/joey.html">Joey</a></li> <li><a href="our-team/chandler.html">Chandler</a></li> <li><a href="our-team/ross.html">Ross</a></li> </ul> </body> </html>
-
All team members should checkout the master branch and pull the latest code.
git checkout master git pull
Your repository and website should look something like this: