===================================================================== diff ====================================== ===============================git diff--check Check for extra whitespacegit diff--cache--check check for extra whitespace===================================================================== Log ======================================= ==============================git log--no-merges does not display the merge loggit log--no-merges branch1...branch2 display in BRANCH2 but not in Bran
Getting Started with Git********************Linux kernel code and many well-known projects are using Git for source code controlUnderstanding the theory and basic usage of git can help you get more learning resources///////////////////////////////////////////To install Git:Many Linux systems bring git, and if not, you need to install them yourself.Method:# apt-get Install git# apt-get Install Git-doc git-svn git-email Git-gui gitk/////////////////////
Git Learning Notes#####################################################qq:1218761836QQ Group: 150181442#####################################################git installation1. Yum Install gitYum Install Git–yYum install-y git-email Git-gui gitk git-svn Git-cvsWhere GIT-SVN Git-cvs is required to support SVN CVS co-operation (selectable)2. Turn on git command completion (but I can do it without this test). /etc/bash_completion.d/git or Source/etc/bash_c
1. Use commands to find directlyIf you have branch A and branch B, use the following command "Http://stackoverflow.com/questions/1549146/find-common-ancestor-of-two-branches"git merge-base A BYou can view the common parent nodes of these 2 branchesCHUCKLU_ZHCN Branch and Master branch are now available$ git merge-base CHUCKLU_ZHCN Master4e67f05995b7d615fce1e97f18deb000d367a6f9$ git show 4e67f05Commit 4E67F05995B7D615FCE1E97F18DEB000D367A6F9merge:6d0e241 1583a81Author:chucklu date:wed Sep 2 09:15
add this file to the index after you manually resolve the conflict, and commit it with the git commit command, just as you normally modify a file The same. If you use GITK to see the results of a commit, you will see that it has two parent branches: one pointing to the current branch and the other to the branch that you just merged in.ii. resolving conflicts in a mergerIf you do not succeed with automatic merging, git sets a special state in the inde
. Optimistic locking is based on the assumption that, most of the time, this concurrent modification does not cause a conflict.Some conventions The GIT first letter capitalization indicates the Git tool itself. git represents a command in the command line. Prompt> represents the command that needs to be entered.Basic Commands Set user name and mailbox:prompt> git config--global user.name "Xxxname"prompt> git config–global user.email "[email protected]"Use the following command to check wheth
The first thing to make clear is that the git operation revolves around 3 big steps (virtually all SCM)1. Fetching data from Git (git clone)2. Change the Code3. Transfer the changes back to Git (git push)These 3 steps involve two repository, one is the remote repository, and the other one is the local repository, and then the workspace. which1, 32 steps related to remote Server/remote repository/remote branch,2 related to local repository/local branch. git clone will copy a copy to your local, G
repository is actually master.Most notably, I can open a branch at any of the commit points in git! (One method is to use Gitk–all to observe the entire commit record, and then open the branch at any point.) )4. Commit (Commit)In SVN, when you submit your finished product, it will be recorded directly to the central repository. When you find that your finished product has a serious problem, you can't stop it from happening. If the network is interrup
compatible with XEN.
[Root @ localhost ~] $ Chkconfig ksmtuned off
7) restart the system and select the latest kernel.
[Root @ localhost ~] $ Reboot
(2) install XEN Virtual Machine
Restart and select the new kernel to log on, and you can install XEN. Before installing XEN, we will first install some packages that may be used during XEN running.
1) install some development libraries and development tools
[Root @ localhost ~] $ Yum groupinstall "Development Libraries"
[Root @ localhost ~] $ Y
equivalent to running the following three commands:$ mv README.txt README #move$ git rm README.txt #remove$ Git add readme # Trace new filesIn this separate operation, git will realize that this is a renaming.
4. view submission history
After submitting several updates or cloning a project, you can usegit logCommand to view.
By default, no parameters are required,git logAll updates are listed Based on the submission time, and the most recent updates are listed at the top.git logThere are m
$ git branch -r # list
origin/master
origin/next
...
$ git checkout -b masterwork origin/master
Capture branches from different version libraries and give a new branch name in your version Library:
$ git fetch git://example.com/project.git theirbranch:mybranch
$ git fetch git://example.com/project.git v2.6.15:mybranch
Create a list of version libraries that you want to work with regularly:
$ git remote add example git://example.com/project.git
$ git remote # list remote repositories
example
-gui git-gitk
3. Git Configuration
git config --global user.name "yourname"git config --global user.email myaddress@gmail.com
4. Create a local repository
Assume that there is a folder in your home directory that stores the CD ~ /Code
Then you only need to run it in the Code directory.
git initgit add .git commit -m "first commit"
Git init initializes a local repository, the one above ". "indicates to add all the files and folder headers in the curr
(*) indicates the current branch.
Switch branch to experiment
Git checkout Experiment
Branch program OK
Git commit-
Submit work on the branch
Switch trunk
Git checkout master
Git commit-
Git merge Experiment
Merge branches to main roads
Merging failed
View source files
Git is confused because it does not know whether to put the Hello world line in front or the reporting function in front.
Modification conflict
Resubmit
Git commit-
Gitk
branch does not exist, it will be created: git push origin develop
(3) If the local branch name is omitted, the specified remote branch is deleted, because it is equivalent to pushing an empty local branch to the remote Branch:
Git push origin: master
Equivalent to: git push origin -- delete master (delete the master branch of the origin HOST: git push
(4) If the current branch has only one tracing branch, the host name can be omitted: git push
Note that the branch push order is written as 5. O
Install git and yumgit in yum
This method is effective for RHEL, Fedora, and CentOS:
1. yum install git
2. yum istall git-svn git-email git-gui gitk
How to install Git
If you are in a Unix-based system, you can Download its source code from the Git official website Git Download Page and run the following commands to install it:$ Make prefix =/usr all; # as yourself$ Make prefix =/usr install; # Run with root permissionYou need some libraries: expat, c
# view updates to saved filesGit diff HEAD -- readme.txt # view the difference between the latest version in the workspace and version LibraryGit diff
Use the built-in graphical git: gitk to view the differences more easily and clearly. Of course, the Github client is also good.
Delete an object
Git rm Git rm -- cached
Storage and recovery
Git stash # store the current jobGit stash list # view the storage siteGit stash apply # restore the work site
the following packages:Sudo apt-Get install Git-core Git-SVN gitk Git-Gui Git-Email
3. Install the package required for Android CompilationSoftware to be installed for 64-bit systems:Sudo apt-Get install GnuPG flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-devThe following software must be installed to compile the 64-bit operating system android2.2 and older versions:Sudo apt-Get
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.