Use Code Git submit local projects already created a cloud projects

Recently I started using code cloud, simple tidy upload code to the cloud initial configuration code. On the one hand we hope to help people in need, on the other hand to facilitate their use.

Git installation and initial configuration, see another blog Xiao Bian it.

step

1, create a project on cloud code

1.1 Creating project

13299289-a7d27d12e1f3ee3f
image

Instructions 1.2 configuration items

13299289-f5439443bb1ab15c
image

2, on the project to be submitted, select the Git Bash Here

3, the configuration file is ignored

In the directory where the file to be uploaded right, select git bash, git command window open, we need to have some documents are ignored, not to upload, such as the use of idea generation .idea open files and .iml file, we can it ignored, create a file using the following command, ignore the need to configure the file:

input the command:

echo ''>.gitignore  
执行了该命令后可以在文件中看到生成了一个叫.gitignore的文件,打开该文件在其中配置需要忽略掉的文件,如下:
##ignore this file##  target  .classpath  .project  .settings         ##filter databfile、sln file##  *.mdb    *.ldb    *.sln      ##class file##  *.com    *.class    *.dll    *.exe    *.o    *.so    # compression file  *.7z    *.dmg    *.gz    *.iso    *.jar    *.rar    *.tar    *.zip    *.via  *.tmp  *.err   # OS generated files #    .DS_Store    .DS_Store?    ._*    .Spotlight-V100    .Trashes    Icon?    ehthumbs.db    Thumbs.db    # IntelliJ project files  .idea  *.iml  out  gen  .gitignore  

4, local Git repository initialization

git init --初始化本地仓库

5, is connected to the cloud code

git remote add orgin "你的远程仓库地址"(复制链接后结尾是.git,如果没有记得加 .git)  

6, uploads

git add .      --将项目中的所有文件上传git commit -m '对上传文件的注释'git push orgin master    --正式上传至码云中,若上传有问题,可以试试   git push orgin master -f 表示舍弃线上的文件,强制推送

to sum up

从本地上传代码到码云主干还是非常简单的,当然这也是没能充分利用Git工具的一种表现。Git和码云都是强大的工具,这些功能都是九牛一毛,其他的功能会逐步总结的。

Reproduced in: https: //www.jianshu.com/p/9c97d0097e1d

Guess you like

Origin blog.csdn.net/weixin_34289454/article/details/91292619