Git Easy to use

Source: Internet
Author: User

What is 1.Git?

Introduction: Git is the parent of Linux Linus Trovalds, built for managing Linux kernel code, is considered the top level of distributed versioning tools. Smart, friendly, robust and efficient.

Role: Create a new branch, fetch the latest version of the code on the server, and merge it with your main branch.

Clones the database (including code and version information) from the server onto a single machine.
Create a branch on your own machine and modify the code.
Commit the code on the branch you created on the stand-alone.
Create a new branch, fetch the latest version of the code on the server, and merge it with your main branch.
Generate patches to send patches to the main developer.

2. Simple operation

Common commands

Git init git initialization

Git status lists all files in the current directory that have not yet been managed by git, and files that have been managed by git and have been modified but not yet committed (git commit).

git config--global user.name "username" Configure user name

git config--global user.email "Mailbox" configuration Mailbox

git config--list viewing user configuration information

git add "file name" submits the file to the buffer

git Add. Submit all files in the directory to the cache

Git checkout-b <name> Create new branch and switch past

git checkout <name> switch branches

Git branch View all the branches created

Git branch <name> Create new branch

git merge <name> merge name branch into current branch

git branch -d <name> Delete Branch

git branch-d <name> Force Delete branch

git push origin-d master pushes a local branch to a remote branch

Uploading files to GitHub

①git Add. Submit the file to the buffer

②git commit-m "test" to push files to a local library

③git push origin-d master uploads files to GitHub

PS: Put on my github:https://github.com/likepast.

Git Easy to use

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.