is deleted from the real meaning.$ git commit-m "delete files (using:git rm)"Do not worry, however, that the file was only deleted in the latest submission of the repository and is still in the history submission. You can view a list of the historical versions of a file by following the commands below.$ git ls-files--with-tree=head^You can also view the contents
Recently, I used git for version control. I found that git has many commands, so I can write down some common commands for viewing. The following content is a summary of this article, which is quite good. Let's take a look.
Certificate ---------------------------------------
Origin #To create a remote branchGit push Origin:#Delete the local branch (git br-d GIT Remote repository ManagementGit remote-v # to view the server address and the warehouse name of git Remotes show Origin# View Remote server warehouse status git remote add origin [email protected] gith
GIT's general operationsRegular operation is also a few of my own usual commands, learned from pro git this bookgit configuration file
Git's configuration file locationFor all users:/etc/gitconfigFor current User: ~/.gitconfig
To view the configuration methodgit config --list
Ways to modify Configurationsgit config --global user.name "wangyubin" (修改的是~/.gitconfig)
Three basic concepts
The workspace (Workspace) is the root directory of the items in your computer
Registers (Index) like a cache area, temporarily save your changes
The version library (Repository) is divided into local warehouses (locals) and remote warehouses (sqlremote)
Almost all of the commonly used commands are based on these concepts, a picture of victory, the following is a relatively simple diagram, including the most basic command
1. Git document https://github.com/progit/progit/blob/master/zh/02-git-basics/01-chapter2.markdownhttps://github.com/progit/progit/tree/master/zhhttp://www.uml.org.cn/pzgl/201204285.asp if it is a Windows operating system, you can install a visual version controller: Turtle. In this way, you do not need to run the GIT command. Small turtle installation configurat
GitHub without:sssh-keygen -t rsa -C"[emailprotected]"14.git remote Add Origin warehouse address associated repository15.git Push Origin Master pushes all contents of the local library to the remote librarygit push origin:master keeps the local repository and empties the remote repository16.git remote-v viewing the associated remote warehouse17.
protected] git.csdn.net:~ # Upload the repository to the servermkdir robbin_site.git cd robbin_site.git git--bare init # Create a pure warehouse on the servergit remote add origin [email protected] Github.com:robbin/robbin_site.git # Set up the repository addressGit push-u Origin Master # client First CommitGit push-u origin Develop # First submits the local develop branch to the remote develop branch, and the trackgit remote Set-head Origin Master
ArticleDirectory
1. Concept
2. Git Configuration
3. View commands
3. Local Database Operations
4. Remote database operations
5. View File modifications (diff)
6. Reset and revert)
7. Create a tag)
8, Miscellaneous
Because git (GitHub) is used in the project, and git
Git distributed version control system, very abuse of a version of the management system, this post describes the common GIT commands, for not GIT version control of the rookie, for the maintenance of the GIT server Daniel, kneeli
version control system.Git is free software.
Must be put inlearngitDirectory (sub-directories are also fine), because this is a git repository and it cannot be found in other places.
It takes only two steps to put a file in the GIT repository than to put the elephant in the refrigerator.
Step 1: use commandsgit addTell git to add the file to the repository:
$
my_project.git [email protected] git.csdn.net:~ # Upload the repository to the servermkdir robbin_site.git cd robbin_site.git git--bare init # Create a pure warehouse on the servergit remote add origin [email protected] Github.com:robbin/robbin_site.git # Set up the repository addressGit push-u Origin Master # client First CommitGit push-u origin Develop # First submits the local develop branch to the remote develop branch, and the trackgit remote
a versioned projectScp-r my_project.git [email protected] git.csdn.net:~ # Upload the repository to the servermkdir robbin_site.git cd robbin_site.git git--bare init # Create a pure warehouse on the servergit remote add origin [email protected] Github.com:robbin/robbin_site.git # Set up the repository addressGit push-u Origin Master # client First CommitGit push-u origin Develop # First submits the local develop branch to the remote develop branch,
Git common commands initialize the repository
Create a new warehouse to manage existing projects, enter the project directory and entergit init
PS: The command will create a. git directory, but will not proactively incorporate the files in the existing project (you need to add them yourself);
Clo
As a result of a Web project to go to the turntable network (http://www.quzhuanpan.com), and a few friends to do, considering the code hosting, teamwork, so in-depth study of git, the following are some common git commands, share to everyone, I hope you like.1. Create an empty repository (admin, normal user ignored)
git add [file name ] Add a file to git indexgit commit-v when you use the-v parameter you can see the difference in commit git commit-m "This is the message describing the commit" to add a commit message Git commit-a-A is on behalf of Add, add all the changes to Git index a
1. What is git?
Official definition: git is a version control tool.The version here is actually the Code released every time. Git saves the Code submitted every time and gives it a number called "version number. This is similar to the process of publishing a journal. Each publication has its issue number.2. Why use git
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.