1,首先在码云上新建一个项目,如下图所示
![](http://upload-images.jianshu.io/upload_images/5532249-aba9eedcda272814.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1000/format/webp)
2,本地新建一个文件夹
![](http://upload-images.jianshu.io/upload_images/5532249-5e7d6adef2706d3a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/160/format/webp)
3,进入新建的文件夹,点击鼠标右键,选择git bash here
然后在窗口输入 git init 这时候文件夹会多出一个.git文件夹,看不到文件夹的,点击鼠标右键选择“显示不显示隐藏的文件”就可以看到这个文件夹了
![](http://upload-images.jianshu.io/upload_images/5532249-3c78b710882fdf57.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/595/format/webp)
![](http://upload-images.jianshu.io/upload_images/5532249-613e53dd5a8be33e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/930/format/webp)
4,进入刚刚在码云新建的项目里,复制框框里的路径
![](http://upload-images.jianshu.io/upload_images/5532249-fcb432466c050d54.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1000/format/webp)
5,然后在回到本地新建的文件夹里
继续操作git
输入git remote add origin + 你刚刚在码云复制的那行路径
![](http://upload-images.jianshu.io/upload_images/5532249-b50d068e0b0ef77d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/595/format/webp)
6,继续输入 git pull origin master 命令,将码云上的仓库pull到本地文件夹
![](http://upload-images.jianshu.io/upload_images/5532249-2947102db6773284.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/595/format/webp)
7,将要上传的文件,添加到刚刚创建的文件夹
![](http://upload-images.jianshu.io/upload_images/5532249-3815846b27689901.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/761/format/webp)
8,使用git add . (. 表示所有的)或者 git add + 文件名 // 将文件保存到缓存区
![](http://upload-images.jianshu.io/upload_images/5532249-ceed907d44342a96.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/595/format/webp)
9,使用git commit -m '新添加的文件内容描述' //添加文件描述
![](http://upload-images.jianshu.io/upload_images/5532249-cb71230387f5f00c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/595/format/webp)
10、使用git push origin master ,将本地仓库推送到远程仓库
![](http://upload-images.jianshu.io/upload_images/5532249-58d2e0911e8bdb06.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/595/format/webp)
11,回到码云,刷新试试,就可以看到新建项目了
![](http://upload-images.jianshu.io/upload_images/5532249-8dba564c29288f7b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1000/format/webp)
作者:啥啥啥娜娜
链接:https://www.jianshu.com/p/3e0b213ab03d
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。