Lab Question 2: Merge two branches results
Go through following set of instructions to complete this question.
NOTE: Ensure that the repo https://github.com/cloudyuga/git-gh-course is forked in your GitHub account and your forked repo is cloned locally.
- Create two branches with name
log-list and oneline-logs
- In the
log-list branch, create a file logs.txt which should contain the output of git log command. Hint: Use redirection operator. Then, save the changes under commit message Added git log list.
- Now, switch back to
main branch and create another new branch oneline-logs. In this branch, create a file logs.txt which should contain the output of git log --oneline command. Then, save the changes under the commit message Added one line git log list.
- Finally, switch back to
main branch.
- Merge the branch
log-list to main branch.
- Try to merge branch
online-logs to main branch.
- Resolve the conflicts. Continue with git merge. (git merge --continue`)
- The final output of
logs.txt should be same of the output of git log --online command.
- The
git log command should show following output:
zzzzz (HEAD -> main) Merge branch 'oneline-logs' into main
yyyyy (oneline-logs) Added one line git log list
xxxxx (log-list) Added git log list
Then, push the changes to your main branch to your forked REPO.
Finally, create the pull request to original repo.
Lab Question 2: Merge two branches results
Go through following set of instructions to complete this question.
NOTE: Ensure that the repo https://github.com/cloudyuga/git-gh-course is forked in your GitHub account and your forked repo is cloned locally.
log-listandoneline-logslog-listbranch, create a filelogs.txtwhich should contain the output ofgit logcommand. Hint: Use redirection operator. Then, save the changes under commit messageAdded git log list.mainbranch and create another new branchoneline-logs. In this branch, create a filelogs.txtwhich should contain the output ofgit log --onelinecommand. Then, save the changes under the commit messageAdded one line git log list.mainbranch.log-listtomainbranch.online-logstomainbranch.logs.txtshould be same of the output ofgit log --onlinecommand.git logcommand should show following output:Then, push the changes to your
mainbranch to your forked REPO.Finally, create the pull request to original repo.