git从入门到上手(一)

1.在linux下安装git~$ sudo apt-get install git 

2.~$ git 

usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

这些是各种场合常见的 Git 命令:
开始一个工作区(参见:git help tutorial)
   clone      克隆一个仓库到一个新目录
   init       创建一个空的 Git 仓库或重新初始化一个已存在的仓库

在当前变更上工作(参见:git help everyday)
   add        添加文件内容至索引
   mv         移动或重命名一个文件、目录或符号链接
   reset      重置当前 HEAD 到指定状态
   rm         从工作区和索引中删除文件

检查历史和状态(参见:git help revisions)
    bisect     通过二分查找定位引入 bug 的提交
   grep       输出和模式匹配的行
   log        显示提交日志
   show       显示各种类型的对象
   status     显示工作区状态

扩展、标记和调校您的历史记录
   branch     列出、创建或删除分支
   checkout   切换分支或恢复工作区文件
   commit     记录变更到仓库
   diff       显示提交之间、提交和工作区之间等的差异
   merge      合并两个或更多开发历史
   rebase     本地提交转移至更新后的上游分支中
   tag        创建、列出、删除或校验一个 GPG 签名的标签对象


协同(参见:git help workflows)
   fetch      从另外一个仓库下载对象和引用
   pull       获取并整合另外的仓库或一个本地分支
   push       更新远程引用和相关的对象


命令 'git help -a' 和 'git help -g' 显示可用的子命令和一些概念帮助。
查看 'git help <命令>' 或 'git help <概念>' 以获取给定子命令或概念的

帮助。

lzjf@LZJF-PC MINGW64 /
$ git config --global user.name "zlycong"

lzjf@LZJF-PC MINGW64 /
$ git config --global user.email "[email protected]"

lzjf@LZJF-PC MINGW64 /
$ cd D:

lzjf@LZJF-PC MINGW64 /d
$ cd www
bash: cd: www: No such file or directory

lzjf@LZJF-PC MINGW64 /d
$ mkdir www

lzjf@LZJF-PC MINGW64 /d
$ cd www

lzjf@LZJF-PC MINGW64 /d/www
$ pwd
/d/www
lzjf@LZJF-PC MINGW64 /d/www
$ mkdir testgit
lzjf@LZJF-PC MINGW64 /d/www
$ cd testgit
lzjf@LZJF-PC MINGW64 /d/www/testgit
$ pwd
/d/www/testgit
lzjf@LZJF-PC MINGW64 /d/www/testgit
$ git init
Initialized empty Git repository in D:/www/testgit/.git/

lzjf@LZJF-PC MINGW64 /d/www/testgit (master)
$ git add window.py
#这相当于添加到了本地缓冲区
lzjf@LZJF-PC MINGW64 /d/www/testgit (master)
$ git commit -m "window.py提交"
[master (root-commit) aa9c25c] window.py提交
 1 file changed, 5 insertions(+)
 create mode 100644 window.py
#这相当于将文件提交到了仓库,我觉得就是提交了git的服务器上
lzjf@LZJF-PC MINGW64 /d/www/testgit (master)
$ git status
On branch master
nothing to commit, working tree clean
#意思是缓冲区没有什么可以提交的
lzjf@LZJF-PC MINGW64 /d/www/testgit (master)
$ cat window.py
import os
file_path="C:\\Users\\zc\\Desktop\\python\\start.bat"
cmd='schtasks /create /tn "compress_upload" /tr %s /sc daily /st 16:00:00'%file_path
os.popen(cmd)
lzjf@LZJF-PC MINGW64 /d/www/testgit (master)

$

转载大神的图片:http://www.cnblogs.com/1-2-3/archive/2010/07/18/git-commands.html


git部署步骤:

git:develop分支是预生产,master分支是生产,分支权限找领导开通

Airflow代码操作必须先提交到预生产测试,

1:commit修改后的代码提交到git,增加tag(一般是日期),发邮件,等运维部署

2:测试没问题后,通过master分支提交部署生产,同样是增加tag,发邮件,等运维部述


猜你喜欢

转载自blog.csdn.net/weixin_41893060/article/details/80751764
今日推荐