Self-learning git common git (i)

Source: Internet
Author: User
Tags commit diff using git version control system git commands lenovo
(a) write the local git library and some common git commands, the infrequently used git will not write (ii) The use of GitHub repositories will be written laterSecret: I have a great git video tutorial Oh, private, I remember the top one. Preface: Git

Git---The stupid content tracker, a fool-tracking device. Linus Torvalds the way to introduce Git to us. Git is a free, open source distributed version control system for agile and efficient processing of any or small or large project.

Features of Git:

From a general developer's point of view, Git has the following features:

1. Clone the complete Git repository (including code and version information) from the server to a single machine.

2, in their own machine based on different development purposes, create branches, modify the code.

3. Commit the code on the branch you created on the machine.

4. Merge branches on a single machine.

The above features can be seen below to see the basics of these features you will understand ...
Premise: Baidu/google git download the corresponding system git

The first part: Creating

Create a new folder as a git library: git init initializes the GIT library when you create a file, uses Git status to view the state of Git, and you can see that the newly created files are not tracked and stored in untracked
Note: The right mouse button in the folder interface will have git bash,git directly into the file
Folder path. You don't need a CD.

Yang Yisheng @lenovo-▒▒▒mingw64/c/git_test (Master)
$ ls-a             //View all current file directories
./  .. /  . git/  index.css  index.html  wenben.txt


Part Two: Adding Users (Let git know who is)

Git asks you who you are when you need a commit, so add a user first

Using git config--global user.name yangcheng0605

Using git config--global user.email 944627108@qq.com

Yang Yisheng @lenovo-▒▒▒mingw64/c/git_test (Master)
$ git config--global user.name YangCheng0605
Yang Yisheng @lenovo-▒▒▒mingw64/c/git_test (Master)
$ git config--global user.email 944627108@qq.com
Yang Yisheng @lenovo-▒▒▒mingw64/c/git_test (Master)
$ git config--list
Core.symlinks=false
Core.autocrlf=true
Core.fscache=true
Color.diff=auto
Color.status=auto
Color.branch=auto
Color.interactive=true
Help.format=html
Http.sslcainfo=c:/program FILES/GIT/MINGW64/SSL/CERTS/CA-BUNDLE.CRT
Diff.astextplain.textconv=astextplain
Rebase.autosquash=true
Filter.lfs.clean=git-lfs Clean--%f
Filter.lfs.smudge=git-lfs Smudge--%f
Filter.lfs.required=true
Credential.helper=manager
user.name=yangcheng0605
User.email=944627108@qq.com
Core.repositoryformatversion=0
Core.filemode=false
Core.bare=false
Core.logallrefupdates=true
Core.symlinks=false
Core.ignorecase=true

Part III: Adding (Administration of the local Git repository)

Need to add trace status to file: Git add Filename;

Git add command to add a workspace file to staging area (wait for commit committed)

Then use git commit-m ' this once modified comment '

Save the file from staging area to the repository.

You can use git log to view the history status of the submission contains the author mailbox comments

Note: You can take advantage of git add when there are too many files in your workspace. Store all the files in the workspace to staging area.

Yang Yisheng @lenovo-▒▒▒mingw64/c/git_test (Master)
$ git status
On Branch Master
untracked files:
  (use "git add <file> ..." to include in what'll be committed)
  "Wenben-\345\211\257\346\234\254 (2). txt"
  "Wenben-\345\211\257\346\234\254.txt"
Nothing added to commits but untracked files present (use "Git add" to track)
Yang Yisheng @lenovo-▒▒▒mingw64/c/git_test (Master)
$ git Add.
Yang Yisheng @lenovo-▒▒▒mingw64/c/git_test (Master)
$ git commit-m ' Add library file All files not tracked '
[Master 1feb61e] All the files that are not tracked under the Add library file
5 files changed, 5 insertions (+)
Create mode 100644 "Wenben-\345\211\257\346\234\254 (2). txt"

If you feel that you are saving to a repository from a workspace to staging area, you can use the Git commit-am ' comment to store the workspace files directly into the repository at once.

Here is my revised index. html file He showed the modified status.

 

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.