Conclusion

Conclusion

Congratulations! You now know the key concepts that make Git a powerful tool for managing software projects. There is no need to manage multiple copies of your code in various states of readiness—you can manage it all in one directory using Git branches. You can make exploratory changes to your code using branches without worrying whether your changes will break everything—you can always delete the branch and switch back to a branch that you know is in working order! You can be working on multiple branches, switching between them as necessary. And if your experiments are successful you can also merge the changes from your experimental branch into a working branch.

You can think of branches as ‘alternate histories’ of the files in your repository. In one branch your files follow a certain sequence of changes, but in another branch the sequence of changes could be completely different, and you can view and work in either of these alternate histories by using git switch command to switch branches.

If you feel a bit overwhelmed with these concepts that is ok. It takes practice to become comfortable with their use. It is a good idea to spend time tinkering with branching and merging in a repository like the one we've been using in the lesson activities. Don't be afraid to experiment and break things in a throw-away repository. The more you use these tools the more intuitive they will become to you over time.

Once you have an understanding of Git branches you are ready to use the full potential of the distributed nature of Git. Read on!