Git version control

Source: Internet
Author: User

    • git install (window based)

Download window version of client from Http://git-scm.com/download to keep the default options

    • Git basic configuration before use

Configure the user name and mailbox, and after the GIT installation is complete, right-click on the desktop to choose Git Bash here

" your name or nickname. "  " your e-mail "
    • View git version
2.9. 3. Windows. 2
    • Generate SSH Key
Ssh-keygen -T rsa-c "your mailbox"
    • Add SSH keys on GitHub to copy the public key from "Id_rsa.pub" to GitHub
    • If the test succeeds, hi xxx will appear.
SSH [Email protected]
    • Get Project
' Copy the address of SSH or HTTPS on the project homepage '
    • Warehouse initialization requires a CD command to enter the project folder and then initialize it
$ git init
    • Generate a snapshot and deposit into the project index
$ git Add.  #会递归添加当前工作目录中所有的文件
    • Submit
" Enter a hint message "
    • View Logs
$ git log
$ git Reflog
    • Branch
$ git Branch   -v  # View the last commit of each branch $ git branch [branch name]  -d [branch name] # Delete the branch
    • Switch branches
$ git checkout [branch name]   -b [branch name]  # Create and switch to a new branch
    • Pull pulls to get the latest changes from other warehouses. In the second warehouse, make some changes, and then push the changes to the repository at the far end. Then the first warehouse pulls these changes
$ git pull
    • Reset
$ git reset--hard [SHA1]

Git version control

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.