git common commands git init here--To create a local repository (repository), A. Git folder is created under the folder, and all version information, tags, and other content are stored in the. git folder git remote add origin [email protected]: winter1991/helloworld.git--Associate the local warehouse with the remote repository. If you do not execute this command, you need to specify the address of the remote server for each push. Git add--Add and delete from local repository, results will be saved to native cache git Rmgit commit-M "Notes"--Commit, submit the contents of the native cache to the HEAD of this machine Git push Origin master--Push the local commit (commit) to the remote server, origin is the Git remote add origin that command inside the Origin,origin replaced the server warehouse address: git push [email prote Cted]:winter1991/helloworld.git Mastergit Pull Origin Master--Pull A new change from the remote server git status--View status git add-A--Submit all Changes1. Git configuration: git config--global user.name "xxx"--Configure the user name, upload the local repository to the server, on Github will display the configured uploader information here git config--global user.email "xxx"--Configure the mailbox git config--List View Configuration list configuration Sshkey: Use this sshkey to confirm upload permissions when uploading code1. Create a local ssh:ssh-keygen-t rsa-c "Github registered Mailbox" 2Add this sshkey on GitHub: Copy the contents of the C:\Documents and settings\administrator\.ssh\id_rsa.pub files; Login to GitHub --Account Setting--ssh-key--and Add Ssh-key--Paste the contents of the id_rsa.pub;3. Authentication: SSH-T [email protected] appeared Hi xxx! You 've successfully authenticated, but GitHub does not provide shell access. Description The configuration is successful and can be connected to GitHub 2. Building a warehouse Repository : Git init here--Create a local repository git remote add origin [email protected]: username/repository name. Git--associate a local repository with a remote repository, such as If you do not execute this command, you will need to specify the remote server's address 3 each time you push. Download new changes from the remote repository: Git pull Origin master4. Commit local modifications to the remote repository: Git addgit add-a-add changes to the local repository git rm xxx-delete The specified file from the local repository git rm-r xxx-Removes the specified folder from the local repository git commi T-m "comment"--commits the contents of the native cache to the HEAD of the native GIT push Origin master--push the local commit to the remote repository 5. Ignore the specified content using the. gitignore file: 1. Create a. gitignore file at the local warehouse root. Win7 cannot be created directly, you can create a ". Gitignore." File, and the following punctuation is automatically ignored; 2. Filter files and folders: [tt]emp/filter Temp\temp folder; *.suo filter. suo file; 3. Do not filter files and folders:!*.c
git command-line guide