provides a stash feature to "store" the current work site, and then continue to work after resuming the site:1 [[email protected] zhangtest]# git stash 2 Saved working directory and index state WIP on dev:ef9042a Dev Brach new 3 HEAD is now at ef9042a Dev Brach new 4 [[email protected] zhangtest]# git status 5 # on Branch Dev 6 Nothing to commits, working directory cleanNow, with the git status view wo
create method. The parameter is the namespace Name (Fully Qualified Name ). This method has a closure environment where a cache variable is used to cache all generated NamespaceObject objects.
A NamespaceObject object contains three attributes: stash (record the current namespace), fqn (namespace name), and proc (createProcedure object ). The methods include enqueue, call, valueof, merge, getStash, and getExport.
The Code is as follows:
74 var Nam
document.No parameters (1) If the stage area has, then the work area and the stage to do the comparison(2) If the stage area is not, the comparison is done in the workspace and branchCompare the head comparison workspace with the file in the repository that the head pointer points to--cache staging area and branches are compared.9, $ git rm10, $ git stash hide all tacked (modified and deleted) Change,stash
solve them manually.
When you view hello, we will find that:
Git uses
The head points to the commit of the current branch terminal.
After =======,>>>>>>> is the code on another branch that you want to merge over.
The dev after >>>>>>> is the name of the branch.
For a simple merge, edit them manually, and then remove the tags, and finally add and commit as usual.
If the conflict is too complex, you need to use a graphical interface:Git mergetool
git log--graph: View branch merge diagram. 5, Br
First, the basic action
The branch in Git is actually just a checksum containing the object (40 character length SHA-1 string)
files, so creating and destroying a branch becomes very inexpensive.
How does Git know what branch you are currently working on? In fact, the answer is also very simple, it holds a
A special pointer called head.
Create: Git branch iss53
Delete: Git branch-d iss53
Toggle: Git Checkout iss53
Create and toggle: Git checkout-b iss53
To see which branches have been m
policy:First of all, the master branch should be very stable, that is, only to release the new version, usually do not work on it. Work is on the Dev branch, that is, the dev branch is unstable, at some point, such as the 1.0 release, then merge the Dev branch to master and Release version 1.0 on Master. Everyone has their own branch, and sometimes it's time to merge on the Dev branch.Merging branches, plus the--NO-FF parameter can be combined with normal mode, the merged history has branches,
a remote push Send all local tags for push to remote delete remote label store current workspace State view stored workspace State Restore specified stash delete stash restore and remove the specified stash associate a local repository with a remote repository clone project from a remote repository cloning item cannot be first in the local Init version library S
completed in 1 days. However, the bug must be fixed within two hours, what should I do?Fortunately, Git also provides a stash feature that can "store" the current work site, and then continue to work after resuming the site:$ git stashNow, using GIT status to view the workspace is clean (unless you have a file that is not managed by git), so you can safely create a branch to fix the bug.First determine which branch to fix the bug on, assuming that yo
|\
| * 6224937 Add Merge
|/
* 59BC1CB Conflict fixed
...
When repairing a bug with a code name of 101, it is natural that you want to create a branch issue-101 to fix it
When fixing a bug, there is still work to be done but cannot be submitted can freeze progress
In your current workspace (branch)
$ git stash//freezes the current branch modification
See all Stash
$ git
checkout-b myfeature origin/myfeature
Save content in storage points, indexes and file systems
10. Storage
In git you can put your current working state into a storage stack and then you can take it out again. The simplest scenario is the following:
$ git Stash
# do something else ...
$ git stash pop
Many people suggest usinggit stash apply来代替pop,不过如果这样做
branches: git checkout-b Merge a branch to the current branch: git merge Delete branch: Git branch-d -------Resolve Conflicts-------$ git log--graph--pretty=oneline--abbrev-commit Branch Merge diagram ----------Branch management policy?----------Master Branch Master The cleanest branch does no action on this branchDevelop Branch Dev Developer's main work branch, used for cycle development, rapid iterative developmentModify a bug Fixbug a branch of a bug??????????????????? A very important chap
as to publish, Or, if the dev branch code is stable, it can be merged into Master Branch master.Seven: Bug branches:In the development, will often encounter bug problems, then there is a bug need to fix, in Git, the branch is very powerful, each bug can be repaired by a temporary branch, after the completion of the repair, merge branches, and then delete the temporary branch.For example, when I get a 404 bug in development, we can create a 404 branch to fix it, but the work on the current dev b
to fix, in Git, the branch is very powerful, each bug can be repaired by a temporary branch, after the completion of the repair, merge branches, and then delete the temporary branch.For example, when I get a 404 bug in development, we can create a 404 branch to fix it, but the work on the current dev branch is not yet committed. such as the following:It's not that I don't want to commit, but the work is done halfway through, and we're not able to commit it, such as my branch Bug, which takes 2
branches:In the development, will often encounter bug problems, then there is a bug need to fix, in Git, the branch is very powerful, each bug can be repaired by a temporary branch, after the completion of the repair, merge branches, and then delete the temporary branch.For example, when I get a 404 bug in development, we can create a 404 branch to fix it, but the work on the current dev branch is not yet committed. such as the following:It's not that I don't want to commit, but the work is don
provides a stash feature that can "hide" the current work site, and then continue to work after resuming the site later. As follows:So now I can fix the bug by creating a issue-404 branch.First we want to make sure that the bug is fixed on that branch, for example, I'm now fixing it on the master Branch master, and now I'm going to create a temporary branch on the Master branch, which demonstrates the following:After the repair is complete, switch to
in general in the new Dev branch work, after the completion, such as to publish, Or, if the dev branch code is stable, it can be merged into Master Branch master.Seven: Bug branches:In the development, will often encounter bug problems, then there is a bug need to fix, in Git, the branch is very powerful, each bug can be repaired by a temporary branch, after the completion of the repair, merge branches, and then delete the temporary branch.For example, when I get a 404 bug in development, we ca
corresponding hello.txt file and find that the two lines you modified exist in the file in this form:
In this way, the content in different branches is marked and you need to manually change it and submit it with $ git add hello.txt and commit-M.
Use the $ git log with parameters to view the merging information. Take note of the parameters later.
$ git log --graph --pretty=oneline --abbrev-commit
3. Temporary Storage work site
You often encounter a situation where you are creating a new funct
DevGit add read.txtGit commit-M "Dev"Git checkout master(Note that the next parameter -- no-FF indicates that fast forward is disabled)(Fast Forward merge does not show that it has been merged, but the -- no-FF parameter merged has branches. Negative shows that it has been merged)Git merge -- no-FF-M "merge with -- no-FF" Dev(View the branch history git log -- graph -- pretty = oneline -- abbrev-commit)
Bug branch (the bugg branch is the branch to solve the bug)Idea: when there is still a job
, for example, to publish, or after the dev branch code is stable, it can be merged to the master branch.
7. Bug Branch:
During development, bugs are often encountered, so Bugs need to be fixed. In git, the branches are very powerful, and each bug can be fixed through a temporary branch, after the repair is completed, merge the branches and delete the temporary branches.
For example, when I receive a 404 bug during development, we can create a 404 branch to fix it. However, the work on the curre
corresponding hello.txt file and find that the two lines you modified exist in the file in this form:
In this way, the content in different branches is marked and you need to manually change it and submit it with $ git add hello.txt and commit-M.
Use the $ git log with parameters to view the merging information. Take note of the parameters later.
$ git log --graph --pretty=oneline --abbrev-commit
3. Temporary Storage work site
You often encounter a situation where you are creating a new funct
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.