1. Configure User name and password$ git config--global user.name "x"$ git config--global user.email "x"View User Name$ git config user.name2, clone a git repositoryGit can communicate through a lot of protocols, with three of the most important protocols, Ssh,http,git (a fu
Common commands of svn and git are commonly used: 1. git pull // indicates updating the latest code on the server to the local device. 2.1. git add file path strength and file name 2.2, git commit-m "comment" 2.3, git push // the
We have already introduced the Vi Quick Check table in a previous article. In this article, we'll show you the basic commands you need to get started with Git.GitGit is a distributed version control system that is used in a large number of open source projects. It was written by Linus Torvalds, the founder of Linux, in 2005. This program allows for non-linear project development and enables efficient processing of large amounts of data through storage
execute the git rebase-i head~n to merge.Perform the third step before committing to the remote branch before you need to execute the git pull--rebase Origin Step three: Submit the contents of the local branch to the remote branch: $git push Origin 5. When a phase is completed and the content on its own branch is merged with the main branch, a merge request is c
information. If the change is abandoned, exit the editor.
4. view the project status
View the current work
Git log
View the last three submissions
Git log-N3
Complete viewing
Git log -- stat -- Summary
5. View changes
View submitted updates
Git diff
View the ID of the change, for example
classmate A, you must create a remote dev branch to a localTake a look at Git branch again? There it is.
On the basis of classmate A, I added a new function, the boss urged, hurriedly submit
Boss one day suddenly and I said: You see classmate A, and modified a lot of bugs, not down to learn
git pull origin dev A conflict may occur before the next commit can be resolved.Very fe
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
ID display commit ID$ git relog 6) Discard workspace modifications$ git checkout--file 7) Delete files$ git RM file 4, remote GitHub1) Create SSH key$ ssh-keygen-t rsa-c "[email protected]" all the way to find the. SSH directory Id_rsa (private key) and id_rsa.pub (public key) two files, set up GitHub ssh key2) Create a warehouse on GitHub3) associated Remote Li
defaults to a more conservative' Simple'mode, pushing only the current branch to the remote associated branch of the same name, i.e.'git push'Pushes the current branch.Or use the new habit, follow the above tips, set to simple way.(8) Git Status View workspace status and see what's done on this branch(9) Git log to view the operation log, it is very usefulGit me
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
Level four modeWorkspace Staging Area local warehouse remote Warehousegit config--global user.name "YourName"git confit--global user.email "Youremail"Git initgit Add FileGit commit-m "somecomments"git statusgit diff file to see the difference between the workspace and the local warehousegit log--pretty=onelinegit reset--hard head^ (head~100)
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
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.