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
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 days to complete, bu
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
still very natural and harmonious, from where to obtain, constant filtration conditions, to choose the same or different, the order, that only know how to take the first few. That being the case, let's take a step-by-step look at the details.preparatory work1. Create a test databaseCreate DATABASE Testquery2. Create a test tableCREATE TABLE table1 ( uid varchar) NOT NULL, name VARCHAR (TEN) not NULL, PRIMARY KEY (UID)) Engine=innodb DEFAULT Charset=utf8; CREATE TABLE table2 ( oid IN
First, use Git branch to create a branchUsage Scenario: No experience at the momentGit branch-a Show All branchesGit branch xx create XX branchgit checkout xx switch to XX branchGit checkout-b xx Create and switch to XX branchSecond, use Git stash save and restore work progressUsage scenario: Develop a new feature that has not been developed yet, but need to fix a bug urgently, you can save this progress, fix the bug to commit and then resume the work
=onelineWithout using fast forward mode, the principleBranching policy:In the actual development, we should follow several basic principles of branch Management:First of all, the master branch should be very stable, that is, only to release the new version, usually do not work on it;So where do you work? Work 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 the 1.0 version in the Master branch;You and
information is discarded after the branch is deleted, that is, the merge cannot be seen once. Adding the--NO-FF parameter can prohibit the use of Fast forward mode, the merged history has branches, can be seen to have been merged.In the actual development, the master branch should be very stable, only to release the new version, usually do not work on it;The Dev branch is unstable, and at some point, the Dev branch is merged to master;Everyone works on the dev branch, and sometimes merges on th
The specific method is as followsGit pull Origin branch // error occurred git stash // Restore git stash ClearDevelopers often encounter this situation: It took a few days to do a new function, has changed almost more than 10 files, suddenly a bug needs to be resolved urgently, and then to a build test group. It's often time-consuming and error-prone to rely on manual backups before git comes out.The git
git logGit log-p: Show the differences for each commitGit log-p-X (x number of times, integer): Specifies the number of times the variance is displayedgit log--stat: Displays a brief count of incremental row countsgit log--author= cold Jiang: Show a commit record for an authorGit checkoutGit checkout--* * (file): Revert to file modificationGit checkout-b master remotes/master: Establish a local branch to the server and switch the pastgit branch-d: Delete local BranchGit branch-d: forcibly delete
, and we can see that they have been merged, however, fast forward merge cannot be seen as a merger.
15. Bug Branch1. If you are currently developing on the dev branch, there is a bug that needs to be quickly resolved and merged to the master. In this case, you can create a new branch on the master (Named bug-101 ).The content on dev cannot be submitted, so you need to store it through git stash. After storing it, you can view that the work zone is c
When you update your code with GIT pull, you encounter the following problem:
Error:your local changes to the following files would is overwritten by merge: Please , commit Your changes or stash t Hem before you can merge. Aborting
This problem occurs because others have modified the xxx.php and submitted to the Repository, and you have modified the xxx.php, you have a git pull operation is a good conflict, the solution, in the above
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.