Prior to completing the module below, please complete the Git Me Some Version Control from Laracasts.
If you need access, ask another team member with GitHub admin rights to add you to the Generation Tux organization.
Official Documentation
Note: This module primarily assumes you are using Terminal, and may not cover necessary or extra steps you might need to take when using Git client (such as SourceTree or Tower).
- Initialize a new
local
git repo calledgit_test
. - Create a
remote
repository in your personal GitHub namespace calledgit_test
, and add it as a remote repo (in Terminal or your Git client). - Create a new file called
friends.txt
with the first and last name of 5 people on lines 1-5. - Add the file to the local repo.
- Commit the file to the repo with a message of, "these are my friends".
- Push your changes to the
remote
repo. - Go into GitHub, view the
friends.txt
file, edit it to add a 6th friend, and commit it in the browser with the message, "added another friend". - Next, pull the code to your
local
repo. - Create a branch in
local
calledparty
. - Now, on the
party
branch, add 4 more friends' names tofriends.txt
(for a total of 10). Commit those changes with a message of, "adding more friends for the party". - Next, switch back to the
master
branch, edit thefriends.txt
file (which has 6 friends) and add 9 more friends (for a total of 15). Make sure you include some of the friends you added in theparty
branch, but not all of them. Commit this with a message of, "new friends". - Now, merge the
party
branch into themaster
branch. This should cause a CONFLICT. Edit thefriends.txt
file and fix the merge conflict, removing any duplicate names. The total number of names you'll have at the end of this process will depend on the number of people you duplicated between themaster
andparty
branches. - Commit the changes using the default merge message.
- Push all branches to the
remote
repository. - Switch to the
party
branch (inlocal
) and rebase it from themaster
branch. Push theparty
branch updates to theremote
repo. - In the
party
branch (inlocal
), create a new file calledfamily.txt
with 2 family member's names on line 1 and 2. - Add the
family.txt
file, then stash it. Switch to themaster
branch, pop the stash, and stage the file in the repo. - Now create another file called
pets.txt
with 2 names of your pets. If you don't have any, make them up. - Commit that file (there should now be two), with the message "some of my family and pets".
- Edit the current staged commit and split it into 2 separate commits, 1 for each file with messages, "my family", for family.txt and, "my pets", for pets.txt. Then, push to the remote repo.
- Look at the git log in
oneline
format and verify your commit messages. - In a new working (
local
) directory, create a totally new git repo calledcommunity
. Create a new repo of the same name in your GitHub (remote
) account (in your own namespace). Add theremote
to yourlocal
git repo. - Create a new file (in
local
) called,address.txt
with an address in it. Stage, commit, and push the changes with a relevant commit message. - Next, bring in your
git_test
repo to thecommunity
repo as a submodule. Stage your changes and commit with a relevant commit message. - Now, go into the
git_test
submodule folder, add a file calledtodo.txt
and put a todo item in it. Stage, commit, and push the file (to thegit_test
repo). - Exit out of the
git_test
folder/submodule and go into to yourcommunity
repo's root. Stage thegit_test
folder/submodule, add a commit with the message "first commit with submodule" and push to the remote repo.
When you are done, verify you have pushed your changes to GitHub. Please create a tag called v1.0
with a message of "ready for review" in both the git_test
and community
repos. Be sure your tags are pushed to the remote repository and are visible in GitHub.
In the community
repo, create an issue titled Review Module 1 - Git Basics and assign it to @generationtux-helmsmen.