Typically, when merging branches, GIT uses patterns when possible, Fast forward but in this mode, the branch information is discarded after the branch is deleted.If you want to force the mode to be disabled, Fast forward git will generate a new commit at merge, so you can see the branching information from the
The basic principles of git are described in the previous two-disk article, which is theoretical knowledge. In this article we go back to practice and look at the use of Git branching (branch).In the Code versioning tool, there is a branch concept. When we started building the repository, we had only one main
the current working directory file to the snapshot version that master points to. That is, the changes that 87AB2 commits are removed when switching to the master branch.$ git Checkout MasterMake some changes and commit again. Note that at this point the history begins to appear forked.' Make other changes 'The branch
Git branch management and Git branch managementGit branch management overview
Almost every version control system supports branches in some form. Using a branch means you can separate it from the Development Main Line and continue
staging area for submission.$ git add README test.rb LICENSE$ git commit -m "The initial commit of my project"
When the git commit commit operation is used, Git calculates the checksum for each subdirectory and then saves the checksum as a tree object in the Git repositor
Tag: File mat sed repos. NET git diff stat file objectsSee what branch are currently available[emailprotected] xmrobotium$ git branch* masterCreate a new branch xm2.x[emailprotected] xmrobotium$ git
Git branch learning note and git branch note
Introduction
After two times of Git content, I forgot the concept of branch in the next day and thought it was not very useful. Then I read it again to find out why it is an extremely i
1. Create local branch Local_branch
Git branch Local_branch
2. Create local branch Local_branch and switch to Local_branch branch
Git checkout-b local_branch
3. Switch to Branch Local
Git operations-branch management (2), git operation branch managementResolve Conflicts
Scenario: Create a new branch feature1 and then add it to the readme.txt file.4 create a branch named feature1And then submit it on the feature
can make new changes based on the state of any of the commits, without affecting the previous branch, as the tree has many branches, which can grow anywhere and have no effect on other branches. In fact, I want to say that Git uses the structure of the tree to manage commits, each commit is a node, there is a parent node can have child nodes, and each root node
object, and to the same object as head. such as Git branch test, means to create a local test branch.
git checkout name: Switch to the destination branch, our default main branch is master.
still points to the commit object where the original Git checkout was. Now let's go back to the master branch and see:
$ git Checkout Master
Figure 3-8 shows the results.
Figure 3-8. HEAD moves to another branch after a checkout
This order has done two things. It moves the HEAD pointer back to the master
Use the git branch-a command to view all local and remote branches (git branch-r can view only remote branches)Found that many of the branches that have been deleted in the remote repository are still visible locally.
$ git branch
you like in this branch, so the changes will not affect master, you can change to Bug-free so far
Return to historical version one to see what the historical version of $ git log
The commit is followed by a commit ID, and below is the record of each commit, including the author, time, and comment, and we can decide which version of the history we want to return to based on comment. Then copy the Commit I
Common git commands
First, create a branch: Branchname represents the new branch name, otherbranchname remote branch name
1. Create a new branch based on the current branch, Branchname represents the new
command:
Git branch [new-head-name] [reference-to-(B)]
Or, for example:
Git branch fix-headers head^
This command creates a new head with the specified name, and the head points to the specified commit object. If the Commit object is omitted, it points to the head.
Now, our commit tree looks like this:
(A)-(B)--------
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.