上传本地文件到gitlab 项目里的某个文件夹

参考了

https://blog.csdn.net/p10010/article/details/51336332 

http://blog.51cto.com/wutengfei/2090253

 

 

 

在其他教程里,都是仅仅添加文件到仓库下面,可是如果要添加到仓库里某个文件夹怎么办?

提交文件

git init
git config --global user.name "wtf" git config --global user.email "wtf@daguan.com" git clone git@gitlab.daguancom:19234/linux/linux_datagrand.git cd linux_datagrand //已经拷下来了,就进入这个你想要加进去东西的文件夹里面 echo "this is a test file." > wtf.txt cat wtf.txt this is a test file ! //复制你的文件或者创建文件在这个文件夹里面 git add xxx //“xxx” 是你要加的文件名 git commit -m "add a file named wtf.txt" //加上注释 git push -u origin master //提交上去

 

注意  . 如果创建仓库的时候某个文件不在本地仓库 ,在push之前

 

posted @ 2018-07-06 21:30  LandingGuys  阅读(5713)  评论(0编辑  收藏  举报