In general, the daily use of just remember 6 commands, you can. But skilled use, I am afraid to remember 60~100 a command.Several special nouns are translated as follows.
Workspace: Work Area
Index/stage: Staging Area
Repository: Warehouse area (or local warehouse)
Remote: repository
First, create a new code base
# Create a new Git codebase in the current directory
delete the child module residue directory
5 Ignore some files, folders do not submit
Create a file with the name ". Gitignore" under the warehouse root, write the unwanted folder name or file, and take one row for each element, such as
Target
Bin
*.db
=====================
Git Common Commands
Git branch view all local branchesGit Status View current statusG
Conflict Information>>>>>>>test then Git add,git commit, and finally you can delete the specified branch. My understanding is that a file merge branch with two identical filenames can only hold the contents of one file -, branch management git merge--no-ff-m"Merge with No-ff"Dev Use--no-FF, a new commit is generated at merge, which can be seen from the branch hi
1. Git Common commands: Fast query gitbranch view all local branches gitstatus view current status gitcommit submit gitbranch-a view all branches gitbranch-r view all remote branches gitcommit-am quot; init quot; submit and add comments to gitremote
I. Quick query of common Git commands
Git action notes 1. Create directory $ mkdir learngit $ cd Learngitnbs p; 2. Change the new directory to warehouse $ git init 3. Add a file to the repository N Bsp $ git add readme.txt 4. Submit one or more files together to the repository $ git commit-m "wrote a readme fil E " 5. View the statu
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
test file and directory under the current directory is ignored, and the subdirectory's test is not in the Ignore rule:*.[ OA] Description: Ignores all file rules that end in. O or. A:**/node_modules/ Description: Ignores all folders named Node_modules, and writes directly Node_ Like modules/ .3. Example:Rules: /* !/test /test/* !/test/inner.js Description: Ignores all content, but does not ignore/test directories and/test/inner.js files under the root directory
Transferred from: http://www.cnblogs.com/elfsundae/archive/2011/07/17/2099698.htmlReferences:Http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guidehttp://www.kernel.org/pub/software/scm/git/docs/http://progit.org/book/Git install, configure user name mailbox, SSH server buildHttp://www.cnblogs.com/elfsundae/archive/2011/07/06/2
Address [[email protected] ~] # Git config -- Global color. UI true # Set the color of the Print Output font [[email protected] ~] # Git config -- list # list all configurations of the current user. User. Name = zhengyansheng [email protected] color. UI = true [[email protected] ~] # Cat/root /. gitconfig [user] Name
Storage area code list git stash list recovery store code to workspace recovery: git stash apply delete: Git stash drop recovery and delete: Git stash pop
Feature Branch
To develop a new feature, it is better to cre
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
) (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 br
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
)7) Push Branchgit push Origin master: (pushes content from the master branch locally to the remote Library origin)8) Git Pull: (from a remote crawl branch)12.git Checkout-b DevCreate Branch Dev, equivalent to the following two commands:git branch Devgit checkout dev13.git Checkout Master: (cut back to master branch)14.git
, start with Git stash list, and then restore the specified stash' Git stash apply [email protected]{1} ' to remove your specified version number as [email protected]{1}, stash content is not deleted, use git stash drop to deleteBranch switching, updating issuesEsc,esc.: q! EnterView remote repositories: $
One, git configuration aliasGIT commands some commands that are longer or faster, and can command abbreviations, or aliases. If you knock on it, it's git st git status a lot easier, and of course we are very much in favor of this lazy approach.$
Git branch view all local branches git status View current status git commit commit git branch-A view all branches of Git branch-R View all remote branches git commit-am"Init"Submit and annotate
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.