Managing Multiple Working Directories
git worktree
If you only want to do some quick git operations, like merging/
If you need to have multiple working directories that you can actually build, use gclient-new-workdir instead. Using git worktree and set up environment there would be slower and use more disk space.
gclient-new-workdir
If you are a multitasker or want to build chromium for different targets without clobbering each other, then perhaps you'll like the gclient-new-workdir.py script located in depot_tools. The script works by creating a new working directory with symlinks pointing to the git database(s) found in your original chromium checkout. You can have as many working directories as you want without the overhead and hassle of cloning chromium multiple times.
gclient-new-workdir.py /path/to/original/chromium chromium2
If your file system supports copy-on-write, like btrfs, gclient-new-workdir is
smart enough to use reflink to save copying time and disk space. Better yet, if
the source repo is a btrfs subvolume, btrfs snapshot would be created, with all
the artifacts retained. You can skip environment setup, and rebuilding should be
incremental. This is the most space-efficient way to create a separate working
directory. See https://crbug.com/
Windows devs
gclient-new-workdir.py doesn't support Windows, but you can try
https://github.com/
Chromium OS devs
gclient-new-workdir.py uses symlinks that will not work inside the cros_sdk chroot. If using a local Chromium source for Chromium OS, be sure to use the original working directory.