. c
3. Return to the situations that have not been done
Git reset -- hard (this process is irreversible and returns to the status before modification)
Main. C returns to the initial state.
Check with gitk and return to the initial status
4. directly return to a specific version
Now we switch to the bra branch.
Git checkout bra
Then you can use gitk to check it out. We can see that our previous operati
software repository of yum, so this option is required every time you want to download software from. To keep using third-party sources, install the yum-priorities plug-in and configure the relevant file/etc/yum. repos. d/CentOS-Base.repo. (If there is any error, I hope to point it out)
4. Check the available git modules. because we do not know which versions of Git can be installed in our system, you can use the following command to check and select the latest version of git for installation.
/f_b.diff
Enter Patch/diff:git apply xxx.patchgit apply xxx.diffCheck Patch/diff:git apply --check xxx.patchgit apply --check xxx.diffIf git and the files that need to be patch are not in a directory: (Git under the framework, patch to break into frameworks/base/)git apply --check --directory=base/ xxx.patchgit apply --directory=base/ xxx.patch* * git AM will say later, as well as some command parameters for producing patches and breaking patches * *
We create a f
name of the GNU Interactive Tools package from Git to Gnuit in the latest version, changing Git-core to Git. So when you install Git in a different Linux distribution, as described below, you'll see that git and Git-core have two different names. --ubuntu 10.10 (Maverick) or newer version, Debian (squeeze) or newer version: $ sudo aptitude install git$ sudo aptitude install git-doc git-svn git-email Git-gui gitk The GIT package contains most of the G
1. Installation:
$ sudo apt-get install git
$ sudo apt-get install gitk# This is an official graphical interface that does not need to be installed without
2, CD to the code to be managed, the file is located in the first level of directory
3. Initialization:
$ git init
4, add the current directory all content:
$ git Add.
5, view the status:
$ git status
6. Add Commit:
$ git Commit-am "a."
7, Version comparison:
$ git diff
8. View histor
$ sudo apt-get install python-docutilsInstall Pidgin for open source community IRC Channel$ sudo apt-get install pidginSet up your proxy of pidginConfigure your git$ git config--global core.editor vimTo avoid install GITK set the This alias$ echo "[alias] glog = log--graph --abbrev-commit--date=relative--pretty=format: '%cred%h%creset-%c (yellow) %d%creset%s%cgreen (%cblue%an%creset%cgreen%cr)%creset ' " >> ~/.gitconfig$ git glog # to show the
. # Writing objects:100% (2437/2437), done. # Total 2437 (Delta 1461), reused 1802 (Delta 1048)
Note that you can also achieve this by pushing your filtered history to a new or empty repository and then making a fresh Clone from GitHub.
Using the BFGThe BFG Repo-cleaner is a faster and simpler alternative to for git filter-branch removing unwanted data. For example, to remove any file named ' Rakefile ' (and leave your latest commit untouched), run:BFG--delete-files RakefileTo-re
control system, so some Linux distributions change the name of the GNU Interactive Tools package from Git to Gnuit in the latest version, changing Git-core to Git. So when you install Git in a different Linux distribution, as described below, you'll see that git and Git-core have two different names.--ubuntu 10.10 (Maverick) or newer version, Debian (squeeze) or newer version:?
12
$sudoaptitudeinstallgit$sudo aptitudeinstallgit-docgit-svngit-emailgit-guigitk
The
lxc Rinse
Git-daemon-run git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-arch git-cvs git-mediawiki git-svn des Ktop-base
plymouth-themes The
following NEW packages would be installed:
aufs-tools Cgroupfs-mount Docker.io git git-man libapparmor1 liberror-perl libnih-dbus1 libnih1 makedev mountall Plymouth
0 upgraded, newly installed, 0 to-remove and not upgraded.
Need to get 9,986 KB of archives.
After this operation, 47.2 MB of
view recent submissions. However, there are some techniques for better application. For example, you can use the following command to view specific changes that are submitted each time:
$ git log-p
Or you can just see what file changes are:
$ git log--stat
There's a nice alias. You can try it, display a short submit name and a nice branch diagram and display the submission in one line (a bit like GITK, but at the command line):
$ git config
information
2. Limit the output Length
There are also time-based options, such--sinceAnd--until. The following command lists all submissions in the last two weeks:
$ git log --since=2.weeks
You can also provide several search criteria to list the submissions that match the criteria. Use--authorOption to display the submission of the specified author.--grepOption to search for keywords in the submission instructions. (Note: If you want to obtain a submission that meets both the search criteria,
Linux environment. If you want to use it in Windows, you must build a simulated Linux environment. There are several simulated environments, you can search for it on the Internet. Here we use cygwin to build it. This is very simple.
1. Install cygwin
Download cygwin and go to the next step (Note: if you install cygwin for the first time, select install from Internet
Then, select the installation location, the location of the temporary file, and the settings for connecting to the network. the ke
= oneline displays the submission history in a completely different and default format
Gitk is a tool for git's graphical query and submission history.
9. Git commit -- Amend Undo operation
Eg: git commit-M "Initial commit"Git add File
The GIT commit -- Amend command finally gets a commit, and the second command fixes the content of the first commit.
10. Git reset head filename: cancels the temporary files. This command is a prompt command after git
to do what I like. There is no need to worry about interfering with other members. As long as I do not merge and submit it to the main version library, no working member will be affected. When I don't need this branch, I just need to delete it from my local version library. No itching.
Git branch names can be different. For example, my local branch name is testing, and the name of the main version library is actually master.
Most importantly, I can open a commit branch at any commit point in gi
, 2, 3 ...... As the version number, it must conflict.
When many records are submitted, we only want to view one of the records. You can add the ID of the corresponding record to the end of the log command and add the-l parameter. That is, git log [ID]-l
If you want to view the modified content of the record submission record, you can add the-p parameter. That is, git log [ID]-l-P
Iv. Version rollback:
Now we make the second modification. That is to say, add a button button2 to the layout file
The introduction of git is not much said. Here is just a simple entry-level operation.How to install, initialize, and perform simple operations and branch operations.Everything is simple, not reasonable, but simple operations.Original article, if reproduced, please indicate the source: http://blog.csdn.net/yihui823/article/details/6673804I. Preparation 1. Installation
Under Ubuntu:
Sudo apt-Get install git
Sudo apt-Get install gitk
Windows:
Msysgit
2
// delete the file, and add the delete file operation to the stage show // view commit, tag and other 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 c
experimental
Git commit-A branch commit
Git checkout master
Git commit-a master commit
Git merge experimental merge Branch
Git commit-A submit again after resolving the conflict
Gitk graphical branch display
Git branch-D experimental branch task is completed, and the branch is merged to the trunk, and then the branch is deleted
Git branch-D experimental branch task failed and deleted anyway
Git push updates the local commit code to the remote v
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.