Changing where HEAD is pointing will update your current active branch. For a new repository, Git will by default point HEAD to the master branch. HEAD is used to represent the current snapshot of a branch. You can think of it as a way of switching between different workspaces. The git checkout command allows you to switch branches by updating the files in your working tree to match the version stored in the branch that you wish to switch to. The repository is the same, but a new pointer is added to the current The illustration below provides a visual on what happens when the branch isĬreated. Create a branchĬreating a new branch does not change the repository it simply points outįor example, let’s create a branch called “issue1” using the command git This method allows others toĮasily identify what changes to expect and also makes backtracking simple. It is a common practice to create a new branch for each task (i.e., a branchįor bug fixing, a branch for new features, etc.). To pull the latest changes from those branches. Primary branch or other branches will not affect your branch, unless you decide Multiple development projects taking place using the same source code.īranching enables you to isolate your work from others. The diagram below illustrates how development can take place in parallel A git branch is an independent line of development taken from the same source code.ĭifferent branches can be merged into any one branch as long as they belong Isolates your work from that of other team members. You can takeĪdvantage of branching when working on new features or bug fixes because it It also helps Git to easily merge versionsĪ Git branch is essentially an independent line of development. Needs to be a system in place for managing different versions of the same codeīranching allows each developer to branch out from the original code baseĪnd isolate their work from others. Others will be implementing new features, etc. While some developers will be fixing bugs, In a collaborative environment, it is common for several developers to shareĪnd work on the same source code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |