Compile an Operating System from GitHub

So I’m a professional web developer working on Linux Deepin wanting to improve at C++ and thought the OS would be a interesting project.

So lets say, I want to break the clock on the lock screen so it always reads a time (in project dde-session-ui-master/dde-lock/timewidget.cpp). I don’t do it on my own system because when I break it, I break my OS. So VMs, eh?

So my question is this: How does one set up a codebase from GitHub of an operating system so that they can make and test changes iteratively?

What do you mean by “OS”?

From your example you want to modify some userspace component (I don’t really know how the lock screen is integrated with the desktop environment/window manager/display manager/whatever you’re using). You can simply track where/who the gettimeofday() system call is made (it is probably made as part of some library) and set the return value to whatever you want to clock to show.

Keeping the kernel time from changing will break the operating system because the kernel needs a timer for basically everything: the thread scheduler, networking, filesystems, userspace.

As for using github: clone the repo, make a branch based on the branch you want to follow, make your changes on your branch, compile and install from that branch. Rebase from the base branch when you want to integrate upstream changes.