git、github的使用以及jenkins与gitlab的联动

git只能跟进纯文本文件(文件内部的更改)

word二进制文件 只能跟进大小的变更,不能跟进内容变化

git status -s  无返回表示代码库当前无变更

??表示 刚刚创建的文件,还没提交

A rad.md  暂存区,已经在版本库,但未提交

M 在左边和右边,右边表示未add,左边表示未commit,MM

git commit 只提交所有暂存区的文件,提交成功才真正进入代码库

1.git的安装及使用、

1.git的安装及基本使用

[root@foundation29 ~]# yum install git   -y
[root@foundation29 ~]# mkdir demo
[root@foundation29 ~]# cd demo/
[root@foundation29 demo]# ls
[root@foundation29 demo]# git init     ##初始化git
Initialized empty Git repository in /root/demo/.git/
[root@foundation29 demo]# l.
.  ..  .git
[root@foundation29 demo]# cd .git/
[root@foundation29 .git]# ls
branches  config  description  HEAD  hooks  info  objects  refs
[root@foundation29 .git]# pwd
/root/demo/.git
[root@foundation29 .git]# cd ..
[root@foundation29 demo]# echo westos > readme.md
[root@foundation29 demo]# ls
readme.md
[root@foundation29 demo]# git status -s
?? readme.md

[root@foundation29 demo]# git status -s
[root@foundation29 demo]# git config --global user.name "Your Name"
[root@foundation29 demo]#  git config --global user.email you@example.com     ##设置全局变量
[root@foundation29 ~]# cat .gitconfig 

[root@foundation29 demo]# vim test.txt
[root@foundation29 demo]# git status -s
?? test.txt
[root@foundation29 demo]# vim readme.md 
[root@foundation29 demo]# git status -s
 M readme.md
?? test.txt
[root@foundation29 demo]# git add readme.md 
[root@foundation29 demo]# git status -s
M  readme.md
?? test.txt
[root@foundation29 demo]# vim readme.md 
[root@foundation29 demo]# git status -s
MM readme.md
?? test.txt
[root@foundation29 demo]# git add readme.md 
[root@foundation29 demo]# git status -s
M  readme.md
?? test.txt
[root@foundation29 demo]# git add test.txt 
[root@foundation29 demo]# git status -s
M  readme.md
A  test.txt
[root@foundation29 demo]# git commit -m "add test.

2.让git status -s 忽略指定格式文件

[root@foundation29 demo]# vim .gitignore   ##该文件中记录要忽略文件的格式,本例为以.开头的文件

[root@foundation29 demo]# vim .file
[root@foundation29 demo]# git status -s    ##已忽略

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值