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 com
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
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 exampl
: Delete files in your working directory that are not versioned by gitStashed Branches StashGit stash (Gsta): Move all staging area files to the "storage area", similar to another type of work areaGit stash list: View storage queue (Stash lists)Git stash apply: Restore the
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
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
git resolves local conflicts
The process is very simple, mainly using the git stash command for processing, divided into the following steps to deal with.
1. Store local Modifications first
$ git stashThis allows all local modifications to be temporarily stored. is to use Git
)Git diff-cachedView the content to be submitted next time (staged, added to index) (index version and c version)
Git diff master .. testGit diff master... Test than parent Branch
. Gitignore ignore files and do not prompt in Untracked files
Git stash stores the status at a certain time
Http://gitbook.liuhui998.com/3_6
, you need to understand more and more complex concepts, including files, snapshots, work trees, indexes, local repositories, remote repositories, remote, commit, branching, and Stash. So why are software developers still flocking to Git? What is the advantage of CVS versus svn,git?The various advantages of git, the In
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 a
(reference) as a parameter to the command. git revert HEAD: Undo the most recent commit. Git revert creates a new, reverse commit that you can tell git not to commit by using parameter-N.git rmgit rm file: Removes files from the staging zone and also removes the working directory. git rm--cached: Removes files from
After mastering the basics of Git use, you may encounter some common problems. The following are some of the problems that cat Brother screening summary, share to friends, master the points in these questions, Git advanced also completed, it contains the following sections:
How to modify Origin warehouse information
How to configure Git ssh keys
the last two lines, which will be described in the following sections. Git provides many elegant and user-friendly options. If we combine the alias settings, we can use your imagination to make your own Git live.
Color: Is it painful to watch diff every time? So why don't we add color to our Git? You only need to add the three lines to display the red and green
, bugs are like the norm. With bugs that need to be fixed, in git, because branches are so powerful, each bug can be repaired by a new temporary branch, repaired, merged, and then removed by the temporary branch.When you receive a task to fix a bug with a code number of 001, it is natural that you want to create a branch bug-001 to fix it, but, and so on, the work that is currently in dev progress has not yet been submitted: $
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
temporary storage area and workspace, consistent with the previous commit
$ Git reset -- hard
# Reset the HEAD of the current branch to specify the commit, and reset the temporary storage area and workspace at the same time, consistent with the commit
$ Git reset -- hard [commit]
# Reset the current HEAD to specify the commit, but keep the temporary storage area and workspace unchanged.
$
in the workspace will become the non-developed Africa Zone feature before, it's so cool .Rollback is finished, small a in the thought if one day want to return to the version of the feature of the African zone what to do? Come on, you can't just look at the records and roll back through "git log" and go back to what you need to do:macbook-pro-4:p ondo jesi$ git reflog6c439d2 [email protected]{2}: Reset:mov
, if the workspace has been modified without committing, you need to commit or stash
git checkout branch--force//Toggle Branch While resetting buffers and workspaces
git checkout--force//Do not specify branch, used to clear the workspace changes (the buffer is unchanged, if there was an add, then the workspace is consistent with the buffer zone)
files: Git ls-files–deletedRecovery requires the new Checkout:git checkout–Simultaneous operation of multiple files can be done using XargsGit ls-fies-d | Xargs git Checkout--git checkout-f recover deleted filesIgnore committing certain files or folders1. Writing a file name or directory name within a. gitignore file ignores the commit, but only for files or dir
information for each branch
git br--merged # View branches that have been merged into the current branch
git br--no-merged # View branches that have not been merged into the current branch
Git Co
Git co-b
git co-b
G
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.