Final challenge: release day
The Coding Club's website lives in ~/site. The club has moved its meetings to Wednesday, Priya's dark mode is still waiting on its branch, and today everyone needs the finished site on the shared server.
No step-by-step instructions: the objectives say what must be true when you're done, and the checks look inside the repository itself. git status and git log --oneline --graph --all are your friends. The cheat sheet and search (/) are allowed, and hints are below the terminal.
The brief
- Fix it on a branch. The home page should say We meet on Wednesdays. Make that change on a new branch of your own, commit it there, and merge it into
main. - Priya's dark mode is in. Her
dark-modebranch is merged intomain. It conflicts: sort it out, and leave no conflict markers behind. - A private to-do list. Keep your own
todo.txtin~/site, but it must never end up in Git, not in any commit. - Shared. A bare repository at
/srv/git/site.githas your finishedmain. - Teammate ready. A clone of it in
~/site-copyis up to date with the sharedmain.
Stuck? Hints
Open only as many as you need.
1. Fix it on a branch
git switch -c NAME makes a branch and moves to it. Change the line (sed -i or an editor), git commit -am "…", then go back to main and git merge NAME.
Still stuck: lesson 2.
2. Dark mode
git merge dark-mode stops with a conflict in style.css. Either edit the file and delete the <<<<<<<, ======= and >>>>>>> lines, or take one side with git checkout --theirs style.css. Then git add and git commit.
3. A private to-do list
Put the name in .gitignore before you add anything, and commit the .gitignore. git status should no longer mention todo.txt. Careful with git add .!
Still stuck: lesson 1.
4. Shared
Make /srv/git yours with sudo, create an empty bare repository with git init --bare, add it as origin and push main. Push again after later commits.
5. Teammate ready
git clone /srv/git/site.git ~/site-copy. If you push more later, git pull inside the copy brings it up to date.