Dev for next development
Common commands:
Git config--global user.name git config--global color.status auto git config--global color.diff auto git remote-v/ / View the git path of a remote branch
files from the current trace list and remove them completelygit rm readme.txt#Delete only in staging area, keep files in current directory, no longer trackgit rm–cached readme.txt#Renaming Filesgit mv reademe.txt Readme#View the history of a submissiongit log#Modify the last commit comment, using the –amend parameterGit Commit--Amend#forgetting to commit some changes, the following three commands will only get one commit.
has been copied, do not need to press COMMAND+C."2. Configure Git's command aliases"Setting aliases for common git commands saves you from having to enter a long string of commands each time, and in Git it's easy to implement the alias setting with the git config command, a
the file in two categories, whether to keep the file in the current directory, you need to keep:$ git rm--cached filename does not need to be preserved:$ git rm filenameView commit History$ git logCan. For more high-end usage, view documentsUndo ActionA revert operation similar to SVN:$ git checkout--filename.md$
bbaf6fb5060b4875b18ff9ff637ce118256d6f20, we executed the 'git reset bbaf6fb5060b4875b18ff9ff637ce118256d6f20 ', then the result is only three submitted versions of the A-C.
Differences between git revert and git Reset
Git revert is used to cancel an operation. The commit before this operation will be retained.
BranchesGit branch-r# Start Tracking One remote branchGit branch--track some_branch origin/some_branch# Change to the branch locallygit checkout Some_branch# make changes and commit them locally....# Push your changes to the remote repository:git pushTo create a remote branch# Create a new branch locallyGit branch Name_of_branchgit checkout Name_of_branch# edit/add/remove Files # Commit your changes locallygit add fileNameGit commit-m Message# Push changes and new branch to remote repository
Create a label
ID"blablabla ... " "blablabla ... "
Action Label
-D v0. 1 --tags Delete remote tag git push origin:refs/tags/v0. 9 ---D can delete a local tag;? command git push origin:refs/tags/
Using GitHub
True----The settings of global user.email email and so on.
Ignoring special files
? When you omit certain files, you need to write. gitign
Some of Git's basic commands
Common git commands
Make sure that you have installed the GIT client
General Configuration
git--version //view git version info
git config--global u
Http://www.xbc.me/git-commands/ Get git Repository
Initialize a version Repository
Git init
Clone remote version Library
Git clone git@xbc.me: WordPress. Git
Add the remo
Recently, various project teams have turned from SVN to git
You'll be sharing some of the most common git operations and usage experiences in the near future:
Let's look at some of the commands you need to use in your work:
---------------------------
The basic common commands for
branch-D branch name (delete Branch)Git branch-D branch name (Force Delete Branch)Git pull (capture the latest commit)Git Branch -- Set-upstream Dev origin/dev (specify the connection between the local branch and the remote Branch)Git reset head readme.txt (clear readme.txt content in the temporary storage area)
Common GIT Commands summaryWith R brother came to the new company (a transition from hardware to the Internet company), the new company's previous code is basically using SVN version control, and even some code is not version control, so called Hg did a git share, ready to put all the company's code git version control
These operation commands are from Liaoche Teacher's official online to see the PostScript down, the following is the official website of Liao Xuefeng Teacher, we can see, tutorials good ~http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b0001. Install Git on Windows: http://msysgit.github.io/default installation is available, open Git-
There are many installation tutorials for installing Git online, so you can refer to them. Here is the version of Git with Windows, click here to download. After the basic setup is complete, you can see the new git commands added by right-clicking the mouse button: Git GUI h
Common Git commands
For the Git basic tutorial, refer to the next article: Git basic tutorial.
Category
Specific commands
Local submission
Initialize the Repository: git init
Add the fil
Git has also been used for some time, the use of their own commands used to record their own description, to facilitate their own memos and other people to facilitate reference.
Directory:
The most basic command :
git clone copies and tracks the remote Master branch. The benefit of tracking is that you can later submit or obtain remote, up-to-date code directl
] that has been committed delete a file git commit-a commit all changes to the current repos git add [file name] Add a file to git indexgit commit-v When you use the-v argument you can see the difference of commit git commit-M"This is the message describing the commit"Add commit information
Objective
Here does not introduce git, table a see the command line is afraid, commonly used commands are these, basically meet more than 99% of the project needs, very practical.
Body
First, Common git command
1.1 Git clone
From remote library clone code to local, directory is used to specify a new directory n
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.