Share knowledge of Python next day

The next day notes

First, what is Git

Git is an open source distributed version control software for efficient, high-speed processing from very small to very large project version management. Git was initially designed and developed by Linus Torvalds to manage Linux kernel development. Git is a free / free software distributed under the terms of the GNU General Public License version 2, see the installation: http://git-scm.com/

Cloud code is a Git-based remote file hosting platform (with GitCafe, BitBucket and GitLab etc.).

Git version control itself can do, but all of its contents and imprint can only be saved in this machine, if you want the contents of the file and the version stored in the remote while recording, you need to use cloud code combination. scenes to be used:

Uncensored Cloud Storage: Maintain last file in the folder within the local file .git

There cloud warehouse code: maintain last file in the folder local .git file, but also will last for files hosted on a remote repository

Second, the Git download, installation and use

Download 1. Git's

Git's official website: https://git-scm.com/, according to their own choice of system installation

2. Git installation

            点击Next

Select the installation path

Continue to click Next

Click Install to install

Installation in progress

The installation is complete, click Finish end

3. Git usage

3.1 installed, the first thing Git

Git prior to initial use, the first command line in command Git

$ git config --global user.name "你的名字"
$ git config --global user.email "你的Email"

Because Git is a distributed version control system, so that each machine must yourself first: your name and Email address.

Note --global parameters git config command with this parameter, all Git repository that you will use this configuration on this machine, of course, you can specify a different user name and Email address of a warehouse.

3.2 Create your own Git repository

You need to create a directory in a place you like, run Git commands in this directory

git init

So you have to initialize a new Git repository, after initialization, automatically creates a .git folder in the current directory, the file is Git most important folders, documents, and Git version will be saved in this folder If you do not see it, it does not matter, because it is afraid that you do not accidentally hurt it, open the hidden attribute.

3.3 release file in the repository, look at their workflow

Git workflow is generally so

  • Add in the working directory, modify the file
  • File version management will need to be placed in the staging area
  • The documents submitted to the staging area to the Git repository

Three states Git file management

  • Modified (modified)
  • It has been staging (staged)
  • Has been submitted (committed)

Your local Git repository has maintained three "tree" form, which is the core framework of Git.

This three trees are: the working directory, staging area and Git repository

Working directory (Working Directory) code that is stored in local projects.

Staging area (Stage) for temporary storage of your changes, in fact it's just a file, save the file list of information to be submitted.

Git repository (Repository) is a safe storage location of the data, this side has submitted all versions of your data. Which, HEAD pointing to the most recent version into the warehouse

3.4 Basic Operations

Add items to the staging area

git add 文件名

Project submitted to the local Git repository

git commit -m '本次提交描述信息'

View Git current status, such as: which files have been modified, those documents have not yet committed to the repository, etc.

git status

The local files, cloud pushed to the remote repository code

git push -u origin master

Higher-order usage, continue to improve in the future

Guess you like

Origin www.cnblogs.com/tianming66/p/11681229.html