Git compile installation and common commands =========================================: compiling installation and setting 1.1: Introduction GitHub website address (download source package): https://github.com/git/ Git.git git downloads on systems such as Windows Mac: Https://git
Reprint please specify the source: Alvin Lee's Blog: Http://blog.csdn.net/lihaoweiV
The git rebase command is powerful, and in the Git Authority Guide, change the order of submission, which teaches a very complicated method, using git reset ... git cherry-pick ... Wait for the order.
But if you use
A few important conceptsFirst, define several concepts:
WorkPlace: Work Area
Index: Staging Area
Repository: Local Warehouse/Repository
Remote: Repository
When cloning a project locally on a remote (such as GitHub) (assuming the project is named Gittest), you will see a directory named Gittest on the local directory with the Project code and a directory named . Git. What is a workspace, except for the .
modified content. In this case, Git does not know what line of content is needed, so you have to decide what you want.Once the resolution is complete, it can be submitted normally.
Common git commands
View File diffgit diff # Compare current file and staging area file diff git diffgit diff # Compare the differences be
Git: basic operations of Common commands and git operations
I have been using cvs, svn, or the little turtle client for development. I have never heard that Git is powerful and useless, git is also used by the company. At this time, I need to know exactly how to use
The advantage of git is not to say more. The only problem that prevents the novice from experiencing it is that the threshold is too high and the script looks like a heavenly book,This article focuses on how to use Git for versioning in Android studio, as well as a very simple operation like TFS.A few months to use down, what I do every day is to start work, ALT + DOWN ARROW keys, pull the data from the ser
, such as intermediate files generated at the time of program compilation, and so on.GIT provides a document-ignoring mechanism for writing document information in the working directory that you do not want to accept in git management in the. gitignore file in the same directory. For example: in the working directory there is an zh directory, if you do not want to add it to git management, then execute:echo
Common git commands, git
Git statusGit add puts the workspace in the hold ZoneGit commit puts the hold zone into the version ZoneGit add submits all modified files to the hold ZoneGit commit-m "Remarks written when submitting" no referenceGit commit-a-m "Write remarks upon submission" directly submit the workspace to t
When using a git command that can has a large amount of output (like git log , git diff or git blame ), Git opens the command outpu T in our terminal "pager"; On most modern unix-based systems, the default pager would be ' less '. Learning a few less
Git: Configure identity and query, create a code repository, view files in the repository, and share commands. git Repository
1. Configure identity and query
Git config -- glocal user. name "me" git config -- glocal user. email "A@me.c"
2. Create a code repository
Cd aa
that developers can submit locally under distributed Each developer machine has a server database backup file record history back to the past multi-share003. Git workflowWorkspaces: code written at work staging area: Staging, helping us save the code as a transition layer to avoid misoperation protect workspace and version area Branch processing version area: Manage version, code action in repository generates version004. Some basic Linux
初始化A directorygit init添加本地修改的文件add .
Which. Represents adding the current directory under all modifications additions to the file, if you want to add the specified directory or file separately. Replace it with a directory or file address.
提交更新commit -m ‘注释‘
The submission here is submitted to the local repository.
删除文件git rm file/dir
Using the shell directly rm file aft
1, (first into the project folder) by command git init to turn this directory into a repository that git can manageGit init2. Add the file to the repository, using the command git Add. Add to staging area inside, don't forget the decimal point ".", meaning to add all the files under the foldergit Add.3. Use the command git
may not have the public key added to this machinewarning:permanently added ' github.com,192.30.255.112 ' (RSA) to the list of known hosts.Permission denied (PublicKey).Fatal:could not read from remote repository.First, follow the steps on Baidu, the SSH password (C:\Users\ user name \.ssh\id_rsa.pub) in the password added to their own GitHub website, this can be Baidu.Running GIT push Origin master again has the error above, and then the point is:ssh
#添加当前修改的文件到暂存区
git Add.
#如果你自动追踪文件, including files that you have manually deleted with a status of deleted
Git add-u
#提交你的修改
git commit–m "your comment"
#推送你的更新到远程服务器, syntax for git push [remote name] [local branch]:[remote branch]
Git push Orig
parameter to delete the specified project. git stash clear: delete all projects.
23. Git reflogGit reflog is a command for managing reflog. reflog is a mechanism that git uses to record reference changes, such as record branch changes or head reference changes. when git reflog does not specify a reference, the reflog
Git is a powerful distributed versioning tool that applies not only to the source code for managing large open source software (such as Linux kernel), but also to managing private documents and sources (such as: Wsi-lgame-pro)
For more information about git, please refer to my previous blog: Git version management tool
First,
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.