Summarize your git common commandsGit also has a period of time, the use of their usual commands with their own description of the record, convenient for their own memo is also convenient for other people to refer to.Directory:The most basic command :git clone copies and tracks the remote Master branch. The advantage of tracking is that you can submit or get the
1. Git remote–vView Remote repositories2. Git remote add weixin-old-remote https://git.sprucetec.com/meicai/weixin-old.gitAdd a remote repository3. Git fetch upstreamThe pull does not change in the local repository and does not modify your own files.4. Git branch–rView all branches on a server5.
branch is currently present the error
Git checkout branch Name: Switch to the specified branch, if the branch does not exist the error
git checkout-b branch Name: Create a new branch and switch to that branch, equivalent to the above two commands executed successively, if the branch is already present, the error will not switch the past
times to cancel the request, remember to revert in the reverse order, starting from the last time.
4. The final solution to the conflict requires re-submission of code, because the previous revert has multiple commit times, and you can use git to merge them into one commit and submit them once.
Git rebase-I head ~ X (X is an integer that combines the previous steps. Check the log for confirmation)
Follow t
the content information of the testfile.txt file and add "Hello world." After saving② Use the git status command to see that the file display is modified, or you can use the git diff command to see the specific changes③ using the git add command and the git commit command to commit the modified file 4, version of the
Definition: The following abbreviations are used in parenthesesWorkspace: Workspace (W)Staging Area: Index (I)Local Warehouse: Repository (L)Remote repository: Remotes Repository (R)Second, commonly used commands:1. InitializationGit init2. Common configuration information(If you do not use--global, only the configuration information for the current project is set)To set up a proxy:git config--global http.proxy http://xxx.com:portSet User name:git con
Double slash after explanation for commandGit init//can make the current folder into a git repositorygit add git commit-m "xxx"//Once staging area all the changes to the branch. -M followed by the instructions for this submissiongit status//view current warehouse status, whether files have been modified, etc.git diff git log//show commit log from nearest to farth
Create a git project warehouse $git Init configures the personal registration information so that when team collaboration, you can see which user modified which Files $git config--global user.name ' cfanbo ' $git config--global user . email "[Email protected]" If there are temporary files, it is not necessary to submit
I. Overview
First, use a picture to describe the workflow of the main git command in general/uploads/article/20160425/346122bdbaad8e43ba8b7de9d52ab4a8.pngWorkspace: a local working directory. (Remember as a)Index: Cache area, temporarily save local changes. (Note b)Local repository: Native warehouse, just want to submit the head for the last time. (written in C)Remotely repository: remote warehouse. (Write D)
Second, the Order notes
The functional
Here are the GIT commands I used in development
1. Configure git git config--global--add user.email 2. Create a new project git init git add git commit-a-M "xxx"
filename to add the specified file)Step 2:git commit-a-M "submitter" submits the project to the local warehouseStep 3:git Remote Add Origin https://github.com/xxx/xxx.git to the remote repositoryStep 4:git push Origin master to submit a local project to GitHub, you need to enter your username and passwordExampleThe process of using
Turn: http://blog.csdn.net/lxlzhn/article/details/92061971. Project view or execution for test environment and online environment: git init: git initgit: Git pull[email protected]:p Roject.git 2. Project development for Development environments: (after development on 1 basis) first, the commit code involves a configuration, the content of which the tag code is su
through git init command to turn the specified directory into a repository that git can manage
with the command git add tell git to add files to the repository, you can add multiple files
with the command git commit tell
/test2Branch Test2setuptotrackremotebranchtest2fromorigin. switchedtoanewbranch ' Test2 ' [[emailprotected]mynginx]#git Branchmastertest*test2Fallback:1: No fallback for add operation after modification[[email protected] nginx]# echo "haha" >> 3.txt[[email protected] nginx]# cat 3.txt This is just a test!haha[[email Protected] nginx]# git checkout 3.txt[[email protected] nginx]# cat 3.txt This is just a tes
Several useful Git commands that you may not know are useful.1. Export the last modified file submitted
I have been using this command to regularly send it to others for review/consolidation. This command exports the recently submitted modified files to a zip file.
1
git archive -o ../updated.zip HEAD $(git
in Windows, use the Git command method as follows (take Win7 as an example):1, Msysgit is the Windows version of Git can Baidu search git download. 2. After the installation is complete, the Start menu found "git", "Git Bash" to open git
Tags: convenient win32 principle INI defect to make the line BSP self-with ACKHow do I use Linux commands in Windows?There are many on the web saying that installing cygwinportable under the CMD window is a Linux command, but there are some flaws.In fact, there is a very simple and effective way for programmers to use Git Bash.Git is used in program development and 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.