Basic use of Git

Source: Internet
Author: User

Steps to use git:

1. Create a new folder, then enter the terminal,

2. cd < folder path > ——-> enter the current directory;

2.PSW ———— > View current path

3.git init--------------------> Initialize git

4. git config user.name tangranyang ———— > Configure user Information User name, and mailbox

git config user.email [email protected]

5. Git config-l ——————— > View configuration information

6. Git config-global user.name tangranyang —————————— > Configure global git Account

git config-global user.email [email protected]

7. cd< folder path > ——— > Skip to current directory

8. Touch Person.h person.m ——————— > Build files or go directly to build projects and folders

9. Git Add. —————— > Add to Version control, with Dot, add all

9.1 git status ——————— > View commit status

Ten git commit-m "ban version submit" ———————— > Submit to local, submit must add content

10.1 git log ———————— > View historical version

10.2 git config-global alias.lg "Log-color-graph-pretty=format: '%cred%h%creset-%c (yellow)%d%creset%s%Cgreen (%CR)%c (bold blue) <%an>%creset '-abbrev-commit ' —————— > set the output of log

10.3 git config alias.st status ————————— > alias for Status St

git reset-hard head^ ———————— >head for the branch name "^" for a fallback version

Git Reset-hard head~1

Git reset-hard "version number" ——————— > back to the specified version

git reflog ————————— > View all operating versions

———————————————— Network Download ———————————

0.git Init-bare ————————————— > Create a remote repository

1.git clone "URL" —————— network download

2. Git push ——————————— > submit to remote Service

3. Git pull ——————————— > get the latest updates

————————— Configuration ignores Files ——————————

1. Search Gitignore Find oc Ignore file copy

2.CD Catalog

3. Echo-e "Copied content". Gitignore ———————— > generate the. gitignore file

4. Git Add. Gitignore

5.git commit-m "Notes"

6.RM file Delete File

7. Git push

———————————————— settings ignore the submitted profile —————————————

Basic use of Git

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.