如何在Git提交空文件夹

1,git clone url

拉取代码至本地

2,mkdir 文件夹名称

在本地创建文件夹

3,cd 文件夹名称

git init

初始化文件夹

vi .gitkeep

创建.gitkeep文件,内容如下

# Ignore everything in this directory 
* 
# Except this file !.gitkeep 

4,回到上级目录,git add .

5,git commit -m '提交信息'

6,git push origin master

猜你喜欢

转载自www.cnblogs.com/sophiazhu/p/10861605.html