mentoring directory is created and you're running all commands from under the directory
The tasks have been sorted in corresponding order.
When asked to leave a comment, please include a number next to the task (e.g. "(1) SHA key: 231ab10982ba...").
[x] check the manual page (git help) and see what it has to offer
[x] initialize the project using git init
[x] create index.html file and fill it with some data (up to you)
[x] add the file to the staging area (git add)
[x] add another file (e.g. testData.txt) and append some text (up to you)
[x] check git status and analyze its results
[x] create your first git commit with the following title: initialize project, add index.html
[x] change the name of exisitng branch to "main" (git branch -M main)
[x] add the remote repo as origin using the git remote command
[x] git push -u origin main the local repository (the -u origin main part must be done once at the beggining, after that you can just use git push)
[x] check the git status
[x] preview git log and paste the SHA key of the fresh new commit in a comment below (1)
[x] create new branch using either git branch and git checkout or an equivalent git checkout -b (find out what it does in the documentation of git - git help checkout). Let's call the branch my-second-branch
[x] if errors occur, please refer to and fix them correspondingly
[x] once on my-second-branch add your favorite image of an animal. I'll call it animal.png
[x] add & create another commit titled add an animal photo and push it (add, commit, push)
[x] see git log and mark your observations in another comment below (2)
[x] git checkout to main and git merge the my-second-branch into main
[x] use git status to analyze the results
[x] git push the changes
Bonus tasks:
[x] add several files and add them to the staging area
[x] use git stash to stash the changes
[x] bring the changes back from the stash (git stash pop)
[x] commit the changes
[x] create & checkout to my-bonus-branch
[x] squash the last 2 commits into one commit with the title squashed last 2 commits
Prerequisites:
git
is installedmentoring
directory is created and you're running all commands from under the directoryThe tasks have been sorted in corresponding order.
When asked to leave a comment, please include a number next to the task (e.g. "(1) SHA key: 231ab10982ba...").
git help
) and see what it has to offergit init
git add
)git status
and analyze its resultsgit commit
with the following title:initialize project, add index.html
git branch -M main
)origin
using thegit remote
commandgit push -u origin main
the local repository (the-u origin main
part must be done once at the beggining, after that you can just usegit push
)git status
git log
and paste the SHA key of the fresh new commit in a comment below (1)git branch
andgit checkout
or an equivalentgit checkout -b
(find out what it does in the documentation of git -git help checkout
). Let's call the branchmy-second-branch
my-second-branch
add your favorite image of an animal. I'll call itanimal.png
add an animal photo
and push it (add
,commit
,push
)git log
and mark your observations in another comment below (2)git checkout
tomain
andgit merge
themy-second-branch
intomain
git status
to analyze the resultsgit push
the changesBonus tasks:
git stash
to stash the changesgit stash pop
)my-bonus-branch
squashed last 2 commits