) (delete an associated remote database name)Git remote-V (list the names of associated remote libraries)Git clone [email protected]: path/repo-name.git (clone a remote library to a local, clone the master branch by default)Git checkout-B Dev origin/dev (create a local branch, switch to the branch, and associate the branch of a remote database to the local branch)Git log -- Graph (view branch merge graph)Git merge -- no-FF-M "merge with no-FF" branch nameGit
details stash // a cache mechanism Status // view git status gitk // graphical interface to view all the COMIT of the current branch, similar to the gitlog GUI version
Most git commands require the current directory (or the ancestor directory of the current directory) to exist. the GIT folder can be executed only in the following situations: 1. git config -- Global xxxx // git global settings 2. git init // initialize git3. git clone // copy Reposito
-commitWhen a bug is temporarily modified, to ensure that the current workspace looks cleanTo store the current unfinished work site.Git stashView a stored workspacegit stash List[Email protected] {0}: WIP on b1:38b2a71 Modify p.phpRecovering a stored workspacegit stash apply [email protected]{0} (after recovery stash content is not deleted) need to use Git
filesgitls-files-tShow all untracked branchesgitls-files--othersShow all ignored filesgitls-files--others-i--exclude-standardgitcheck-ignore*gitstatus--ignoredManipulation: OperationStops tracing a file but does not delete it.gitrm--cachedOrgitrm--cached-rForce Delete untracked files or directoriesgitclean-fgitclean-f-dgitclean-dfClear. gitignoregitclean-X-fChanges: ModifyInfo: View informationView unsaved files after last submissiongitdiffView the files for temporary changes to be submittedgit
the stage.2.2 then execute git rebase-continue to directly create another patch.Repeat 2.1, 2.2 Until rebase is complete. Note that the rebase does not need to explicitly execute commit. Commit is automatically completed by git.3. You can use git diff to view conflicts. Git diff has different meanings in different scenarios.
Git pull:
It is equivalent to git fetch + git merge. If git merge is a quick merge, a commit point is formed.The commit point corresponding to git merge can be referred to
.; Git add-u;Git add-a4. Submission:(1) From staging area I to local warehouse Lgit commit-m [Submit message](2)5. Revocation(1) From staging area I to work area Wgit rm--cached (2) Revert to head versiongit reset--hard HEAD(3) Modify the submitted user name informationgit commit--amend--author= "author Name 6. Remote(1) Change the remote warehouse addressgit remote Set-url origin http://xxx.xx.com/x.git(2) View Remote warehouse logsgit log origin/master(3) Compare local and remote branchesgit d
demand, suddenly this self-happy development way is interrupted, a test branch has a bug needs to be repaired immediately, wipe, the local code has not been submitted, but do not want to because of the temporary submission of local code to describe how the temporary submission of the description. You can then use Git stash to access locally changed code, and then switch to the bug's branch to solve the problem, and finally go back to this point using
, so with the-m parameter, write the commit description in:$ git merge--no-ff-m "merge with No-ff The Dev"Store" The current Job site:$ git stashview a list of stored work sites:$ git stash listRestore the "storage" work site and also delete the stash content:$ git stash popRestore the "storage" work site without deleting sta
the project owner can analyze the program and give certain naming rules. For example, some projects are named based on the functional namespace and some projects are named based on the owner name. However, no matter which method is used, a reasonable namespace will not be reconstructed due to name conflicts when you cooperate with many people in large projects. Therefore, the js file in your site will include the namespace. js introduced first, which defines all namespaces and management for th
commits, you need the following command
1
git rebase -i HEAD~2
Using this command, you will enter an interactive interface that shows the last two commits, and asks you which to compress. The ideal state is your pick last commit and commit it and the previous one squash .Next you will be asked to fill in the descriptive information for the combined submission. This process actually overrides your commit history.8. Save changes that have not yet been submittedFor
for all branch history # git revert modification corresponding to the submission history # undo commit dfb02e6e4f2f7b573337763e5c0013802e3 92818git ls-tree HEAD # Internal Command: display a git object git rev-parse v2.0 # Internal Command: Display SHA1 HASHgit reflog for a ref # Show All commits, including the isolated node git show HEAD @ {5} git show master @ {yesterday} # display the status git log of the master branch yesterday -- pretty = format: '% h % s' -- graph # submit the log git sh
environment where a cache variable is used to cache all generated Namespaceobject objects.
A Namespaceobject object contains three attributes, stash (record current namespace), Fqn (namespace name), Proc (Createprocedure object). Methods include: Enqueue,call,valueof,merge,getstash,getexport
Copy Code code as follows:
Namespaceobject var = function _private_class_of_namespaceobject (FQN) {
Merge (this, {
Forward模式,导致合并后删除原来的分支后,看不出主分支曾经合并过存档list恢复存档git stash apply 存档id删除存档git stash drop 存档id上面的恢复和删除可以用下面的命令合并操作git stash pop 存档id
When working in the current branch for a period of time temporarily need to switch to another branch, but the contents of the current branch cannot be submitted, this time can be used to use the command to log
, so with the-m parameter, write the commit description in:$ git merge--no-ff-m "merge with No-ff The Dev"Store" The current Job site:$ git stashview a list of stored work sites:$ git stash listRestore the "storage" work site and also delete the stash content:$ git stash popRestore the "storage" work site without deleting sta
. If you do, do not panic, because as long as git generally does not actively delete the contents of the local repository, depending on the situation you lost, can be retrieved, such as after the loss can use git reset--hard orig_head immediate recovery, or use Reflog command to view a reference to a previous branch.3.4 StashSometimes, we do some work on one branch and modify a lot of code, and then we need to switch to another branch to do something else. But do not want to do only half of the
, it's usually checkout to make sure there's no conflict.-M"Merge" //Tips for Merging*********************************************************************************************see the following situation to pay attention to conflict. Don't forget to resolve the conflict.*********************************************************************************************master should be published directly. So there should be no conflict when merging to master, so it is not recommended that multi
...//create and switch branches equivalent to git branch b_name git checkout b_nameGIT branch b_name//Create branch PS: Create branch clone from current branchgit checkout b_name//Toggle BranchGit branch//view Current Branch branch operation use this command plus option (-D Delete-D to delete an unincorporated branch) checkout just toggle (-B does not exist will be created)git merge b_name//merge current branch with specified branch--no-ff-m "commit_msg" commit record for this mergegit--graph--
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.