博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
git add
阅读量:7145 次
发布时间:2019-06-28

本文共 1586 字,大约阅读时间需要 5 分钟。

hot3.png

git add

 

git add 跟踪新文件

一下git操作记录,用vim新建一个文件,hi.txt,使用git add跟踪新建的文件

Lenovo@LENOVO-PC /e/HelloGit3/MyDemo2 (master)$ git statusOn branch masterUntracked files:  (use "git add 
..." to include in what will be committed)        hi.txtnothing added to commit but untracked files present (use "git add" to track)Lenovo@LENOVO-PC /e/HelloGit3/MyDemo2 (master)$ git add hi.txtLenovo@LENOVO-PC /e/HelloGit3/MyDemo2 (master)$ git statusOn branch masterChanges to be committed:  (use "git reset HEAD 
..." to unstage)        new file:   hi.txtLenovo@LENOVO-PC /e/HelloGit3/MyDemo2 (master)$

 

git add 暂存已修改的文件

如下的git操作记录,就是因为没有把修改的文件放到暂存区域,从而有Changes not staged for commit,需要对修改的文件使用git add 放入到暂存区才能使用git commit提交。

Lenovo@LENOVO-PC /e/HelloGit3/MyDemo2 (master)$ git statusOn branch masternothing to commit, working directory cleanLenovo@LENOVO-PC /e/HelloGit3/MyDemo2 (master)$ vim hello.txtLenovo@LENOVO-PC /e/HelloGit3/MyDemo2 (master)$ git statusOn branch masterChanges not staged for commit:  (use "git add 
..." to update what will be committed)  (use "git checkout -- 
..." to discard changes in working directory)        modified:   hello.txtno changes added to commit (use "git add" and/or "git commit -a")Lenovo@LENOVO-PC /e/HelloGit3/MyDemo2 (master)$ git commit -m "hello"On branch masterChanges not staged for commit:        modified:   hello.txtno changes added to commitLenovo@LENOVO-PC /e/HelloGit3/MyDemo2 (master)$

 

git add 用于合并时把有冲突的文件标记为已解决状态

===========END===========

转载于:https://my.oschina.net/xinxingegeya/blog/424093

你可能感兴趣的文章
Nginx+tomcat负载均衡配置
查看>>
C#递归删除文件夹目录及文件
查看>>
Jquery Validform使用入门datatype参数详解
查看>>
phpdoc
查看>>
hdu1874
查看>>
linux学习笔记十一:srpm软件包(*.src.rpm)的安装
查看>>
关于android sensor架构
查看>>
Ghost使用方法
查看>>
LAMP安装步骤(操作系统CentOS6)
查看>>
MFA 经验分享
查看>>
备份恢复软件哪个更好用
查看>>
JMeter名词解析说明
查看>>
How to change window manager to OpenBox in Linux Mint 13 Mate
查看>>
iframe自适应内容高度
查看>>
Apache 的 httpd.conf 详解
查看>>
在eclipse上面搭建hbase环境
查看>>
curl json串
查看>>
nagios监控(二)
查看>>
linux和windows的文件共享系统samba的安装
查看>>
Aspose.Words使用教程之如何写入纯文本(TXT)文件
查看>>