Prior to completing the module below it is highly recommended that you look at the following learning material. Even if you consider yourself a GIT expert, there is material in the resources below that even seasoned GIT users are not aware of. It only helps you more.
- GIT Official Site's Documentation book
- CodeSchool.com
- Tutsplus.com
You'll need the indatus login for some of this which is on helpdesk.indatus.com (INDATUS > IT > Development > Learning Resources > Paid Resource Logins). Email [email protected] if you encounter any issues.
- Init a new git repo
- 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 repo
- Commit the file to the repo with a message of "these are my friends"
- Create a remote repository in your gitlab.indatus.com namespace called
git_test
and add it as a remote repo - Push your changes to the remote repo
- Go into gitlab, view the
friends.txt
file, edit it to add a 6th friend, and commit it in the browser with the message "added another friend". - Now pull the code to your local repo
- Create a branch called
party
and switch to it - Now in 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" - Now switch back to the
master
branch, edit thefriends.txt
file (which has 6 friends) and add 9 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 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 with the default merge message.
- Push all branches to the remote repository
- Switch to the
party
branch and rebase it from themaster
branch. Push theparty
branch updates to the remote repo. - In the
party
branch add a new file calledfamily.txt
, add 2 family member's names on line 1 and 2. - Add the
family.txt
file, then stash it, switch to themaster
branch and pop the stash and stage the file in the repo. - Now create another file called
pets.txt
and in it put 2 names of your pets, if you don't have any make them up. - Add both files and commit them with the message "some of my family and pets".
- Now take that last commit and split it into 2 commits, 1 for each file with messages "my family" and "my pets". Then push to the remote repo.
- Look at the git log in
oneline
and verify your commit messages. - Now in a new working directory create a totally new git repo called
community
, create a new remote for it in your gitlab account (in your own namespace). Add the remote to your local git repo. - Create a new file called
address.txt
with your address in it, stage, commit and push the changes with a relevant commit message. - Now bring in your
git_test
repo to thecommunity
repo as a submodule, stage your changes and commit with a relevant commit message. - Now make 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 the repo. - Now get out of the
git_test
folder to yourcommunity
root, and stage thegit_test
folder, add a commit with the message "first commit with submodule" and push to the remote repo. - Now create a
v1.0
tag with the message 'ready for review' and push the tag to the remote repo. - Do the same thing with the
git_test
repo. - Now in both
community
andgit_test
repos within GitLab enable "Issues" as a feature and save. Then go to project members and add all team leaders and dept. manager. An automated email will be sent by GitLab and these people will review the committed code. Any issues will be tracked via the issue tracking feature in the git repo.