1.git
1.1 download and install software win_git
Git official website: https: //git-scm.com/ download version window, press Win + R key on the keyboard, input cmd. All the way to next installation, find "Git" in the Start menu -> "Git Bash", or right-click the new folder on the desktop to display the following
Git与Github的连接与使用:
transfers between the local Git repository GitHub repository and is transmitted through SSH encryption, need to identify whether GitHub you push, GitHub just know that your public key, you can confirm that only you can push:
1.2 git connector provided github
1.
Creating SSH Key, in the user's home directory (C: \ Users \ Administrator) down to see if there .ssh file (ubuntu with ctrl + h to display hidden files), and if so, look at the file and there is no id_rsa id_rsa.pub these two documents, if you already have, directly to the next step. If not, open Git Bash, enter the command, create SSH Key
$ ssh-keygen -t rsa -C "[email protected]" #123... 是你自己注册GitHub的邮箱
Appears on the map, they said created successfully, go to the user's home directory to find the .ssh folder, there are id_rsa and id_rsa.pub two documents, both SSH Key is secret key pair, id_rsa
private key, it can not be leaked, id_rsa.pub
is the public key can be made public.
2.
Next to GitHub, open the "settings-Account-SSH" page and click "Add SSH Key", fill in the Title (random write), the Key text box and paste id_rsa.pub
the entire contents of the file.
3.
Verify successful, enter the following command in the git bash in, careful not to $
copy into it
$ ssh -T git@github.com # 这行不用改
If the first set, the following interface will appear, enter yes agree to
4.
the following start setting up username and email, because github commit every time they are recorded
git config --global user.name "name" #你的GitHub登陆名
git config --global user.email "[email protected]" #你的GitHub注册邮箱
git config --list #查看设置
1.3 git command to upload the github
Right-click on the desktop point Git Bash Here
, the command line git clone 新建库链接
, so the downloaded folder contains .git文件夹
, no git init
, LICENSE may MIT license.
1 工作目录(红)
: Visible
2. git服务器暂存区(绿)
3. git服务器本地仓库
4 github远程仓库
: Visible
1-2:git add . :当前文件夹里的文件即文件夹都添加进来
2-3:git commit -m "你的信息"
3-4:git push origin master
git status #1,2后即来显示红绿
git log #3后即commit后
1.4 to reduce the number of remote repository commit github
New github repository --clone to the desktop --cd just downloaded to the desktop library folder new four files in order git add 新建的4个文件名
, git commit -m""
in the master branch library 123456 git push
upload github Similarly figure below
New 5.txt on github page, the local command line executes git pull
, the local extra 5.txt, this time on the display 5 commits github. Command git log
again git rebase -i 8c26e
(-i parameter is the combined hash value need not commit, in this case the first commit, and then proceeds to vi edit mode, press the arrow keys and key del)
Pick means is to be performed this commit, squash mean a commit before the commit will be merged into. to pick squash or S, and esc: wq save and exit into the commit message editing interface as shown, to a non-comment line and then esc: wq save and exit.
git log
Check local have been merged, git push -f
forced to cover the remote github display only twice submitted.
2gitlab
ubuntu: sudo apt-get install git
, you can directly git clone ... github project (this one not only with the github
connection key), but the ubuntu as shown connected gitlab
to git clone and win as
2.1 construction group
The following is a sample template
2.2 New
Local New Folder git clone are two directories
add can select the new
red exclamation mark indicates that the local directory and local git server (not gitlab remote server) are not synchronized show finished after Add
another git back git commit with the local server synchronization display green
and then git push gitlab synchronized to the remote server
2.3 modify, delete
The exclamation mark is displayed and then modify the local directory and local git server are not synchronized
at this time do not Add, because the version already, simply commit, push
the following graph 删除
: first commit, pull, push
2.4 comparison, the reduction
The following two full ctrl FIG selected for execution
as shown below 还原
: the implementation of selected downlink, master will jump downlink
2.5 GitFlow
master
The most stable branch reservation code feature a
(sub-branch to task team members) on the development submitted to the develop
(also known as the developer branch) merged, project leader agreed to merge. develop
Branch absorbed a lot feature a,b,c
... function and come out of the release
branch (testing, documentation), and then merged into master, hotfix
the branch is an emergency repair master and then merge back
3.Docker
Docker is mainly used linux virtual machine and back-office applications, consists of the following three parts
镜像
like ubuntu image file (iso, img file)
容器
is a running virtual machine
仓库
is stored image file spaces (dockerhub)
3.1 common commands
ubuntu install command: sudo apt install docker.io, Website: play with docker
交互方式:
port mapping, file mapping,
click No. 100 port as follows: The above is dockerfile build into a mirror run into a container
3.2 organize more than one container project: docker-compose
Host (etho) generates a docker mounted docker网卡
between the container through the same network segment ip通信
, and the container is a through host communications over the forward routing network card (端口通信)
, such as deployed in the container 1 is mysql container, the container 2 in the desired direct access, then access 172.27.0.2 port number 3306 can be a
more than able to get nginx container data, but in this way need to log in to view a machine ip, then log on to another machine to configure this ip, in the actual production it is not feasible, the following is true of the production process of communication -link
the need to write two way link by docker run, and you must first create mysql trouble, these instructions to record a configuration file unified configuration, which is docker- compose
create php test.php used to monitor whether the operation successfully
create mysql.php
create nginx.conf
started writing docker-compose
click on the following port 80