Managing Your Worktrees
The previous chapter, Developing with Git, described how you can use Git for project development, including how to create new revisions. In this chapter, we will focus on learning how to manage a working directory (worktree) so that you can prepare content for a new commit. This chapter will teach you how to manage your files in detail. It will also show you how to care for files that require special handling while introducing the concepts of ignored files and file attributes. Then, you will learn how to fix mistakes in handling files, both in the working directory and in the staging area, as well as how to fix or split the latest commit. Finally, you will learn how to safely handle interruptions in the workflow with stashes and multiple working directories.
The previous chapter also taught you how to examine changes. In this chapter, you will learn how to undo and redo those changes selectively, as well as how to view different versions of a file.
This...