1:coding.net注册账号,并创建项目.可以将readme.txt打上勾

 2:cd到本机的项目文件夹下 在git中代表workspace

 3:mac用户用ls -all ,linux用户用ll 或者ls -l查看是否已经存在.git文件夹 该文件夹就是repository(本地的git目录) 如果存在就把它删掉 rm -rf .git

 4:设置git的用户名和邮箱. 如果是coding的账号就使用coding的注册邮箱 和用户名

改config的用户名的命令为

git config --global user.name 'xxx'

  改邮箱的命令为

git config --global user.email 'xxxx@xx.xx'

  5:在git中 要将本地项目推送到云端(例如coding)上必须要先加载到本地的index中 然后推送到git工作站上文中提到的repository

git init
git add . #表示添加所有文件
git add index.html #index.html表示某一个文件名
git commit -m 'xxx'
git remote add http://xxxxxxxx

  6:添加后可以使用status查看git的状态

chenjiadeMBP:Questionnaire chenjia$ git status

On branch master

nothing to commit, working tree clean

出现这种表示没有上传到

  7:add之后 用commit命令 推送到git工作站也就是上文中提到的repository

git commit -m '说明'  #说明中一般填写提交人的姓名和修改的内容 例如我测试一下而已就写个test

 8:最关键的一步 到这里千万不能直接网上push 一定要先将coding上的版本pull下来 来达到版本一致,否则会报错

To https://git.coding.net/cjkk/QuestionNaire.git

! [rejected]        master -> master (fetch first)

error: failed to push some refs to 'https://git.coding.net/cjkk/QuestionNaire.git'

hint: Updates were rejected because the remote contains work that you do

hint: not have locally. This is usually caused by another repository pushing

hint: to the same ref. You may want to first integrate the remote changes

hint: (e.g., 'git pull ...') before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.

git pull https://git.coding.net/cjkk/QuestionNaire.git --allow-unrelated-histories #那个https的地址是自己的coding目录的网址

 9:最后一步了

git push --set-upstream https://git.coding.net/cjkk/QuestionNaire.git master #同上换下地址

 最后更改分支问题了

和把大象放到冰箱里一样 需要三步

1.打开冰箱

git checkout -b dev #创建并切换到dev分支 可以自己改分支名

  介绍一下git branch 查看分支状态  git branch + 名字 创建分支名  git checkout +分支名 切换到指定分支

chenjiadeMBP:Questionnaire chenjia$ git branch

* master

chenjiadeMBP:Questionnaire chenjia$ git branch ccc

chenjiadeMBP:Questionnaire chenjia$ git branch

ccc

* master

chenjiadeMBP:Questionnaire chenjia$ git checkout ccc

Switched to branch 'ccc'

chenjiadeMBP:Questionnaire chenjia$ git branch

* ccc

master

2: 把大象放进去  当前已经是在分支下了,可以进行正常的增删改查操作,都不会影响主分支  类似linux虚拟机的快照功能和古老的系统备份功能

vim test.txt #创建一个test.txt 自己随便写点东西在里面
git add test.txt
git commit -m '测试分支功能'

  这样就是在分支中完成了

3:关门  不关门浪费电 当在dev分支下把阶段任务完成时,直接切回master分支,并把master分支指向dev 之后dev就可以删掉了

git checkout master #切换到master分支
git merge dev #merge合并的意思 将master和dev合并,原理就是将master走到dev那
git branch -d dev #删除分支命令

  over

git上传新项目到coding的更多相关文章

  1. git上传新项目

    命令行指令 Git 全局设置 git config --global user.name "15510728111" git config --global user.email ...

  2. 新浪云git 上传 nodejs项目

    1 .新建一个空文件夹: 2.在当前文件夹下,初始化本地git: 3.将要上传的nodejs工程,拷贝到这里: 这一步很容易出问题,所以最好不要拷贝别人给的node_modules文件,尽量做到现用现 ...

  3. 第一次使用Git上传本地项目到github上

    对于程序原来说都听说过GitHub,GitHub有许多开源的的项目和一些前沿的技术.因为自己在刚刚开始使用Git把自己写的一些小dome放到GitHub上遇到许多的坑,这么长时间过去了,想对第一次使用 ...

  4. Git入门之在IDEA中使用Git上传maven项目

    下载安装git客户端: 参考博文:https://www.cnblogs.com/java-maowei/p/5950930.html 在IDEA怎么使用git上传spring的maven项目详解: ...

  5. 用git上传本地项目到github上

    首先确认自己已经安装了git,打开git bash,输入ssh-keygen -t rsa -C "自己的邮箱地址@XXX.com" ,生成自己的公钥与私钥   一路默认回车,会生 ...

  6. git上传新建项目

    新建立本地项目,现在需要上传到git.对上传过程归纳如下: 一 在gitlab中新建项目:如下图所示: 二,新建后获取url地址,在本地打开gitbash,根据url把git上的项目clone到本地: ...

  7. [Git]使用Git上传本地项目,并同步到Github上

    第一步:先要在github.com中创建一个仓库(New Repository). 第二步,打开Git Bash ① git init [+仓库名]:初始化仓库,执行之后可以在指定的仓库存放地上面看到 ...

  8. 转:git上传本地项目到github

    转自:https://blog.csdn.net/Lucky_LXG/article/details/77849212 将本地项目上传到Github(两种简单.方便的方法) 一.第一种方法:首先你需要 ...

  9. 使用Git上传本地项目到http://git.oschina.net

    本文前言,因倡导开源精神,我也把代码传上了开源社区,可是,当初使用http://git.oschina.net 网站上传代码的时候不知道使用工具.我竟然一个文件一个文件复制粘贴,可费了我好大一个劲儿, ...

随机推荐

  1. [Swift]LeetCode172. 阶乘后的零 | Factorial Trailing Zeroes

    Given an integer n, return the number of trailing zeroes in n!. Example 1: Input: 3 Output: 0 Explan ...

  2. [Swift]LeetCode678. 有效的括号字符串 | Valid Parenthesis String

    Given a string containing only three types of characters: '(', ')' and '*', write a function to chec ...

  3. Python档案袋(文件系列操作 )

    文件读写基础 简单的读文件: # r 表示只能读 #打开文件,得到文件光标对象,文件不存在则报错 f=open("ww.txt","r",encoding=&q ...

  4. Git的使用--如何将本地项目上传到Github(三种简单、方便的方法)

    一.第一种方法: 1.首先你需要一个github账号,所以还没有的话先去注册吧! https://github.com/ 我们使用git需要先安装git工具,这里给出下载地址,下载后一路(傻瓜式安装) ...

  5. Java核心技术及面试指南的视频讲解和代码下载位置

    都是百度云盘,均无密码 代码下载位置: https://pan.baidu.com/s/1I44ob0vygMxvmj2BoNioAQ 视频讲解位置: https://pan.baidu.com/s/ ...

  6. 【jQuery】(1)---初次接触Jquery

    1.浅理解Jquery:jQuery是一个快速的,简洁的javaScript库,使用户能更方便地处理HTML documents.events.实现动画效果,并且方便地为网站提供AJAX交互. 2.D ...

  7. Can't connect to X11 window server using ':1.0' as the value of the DISPLAY variable.

    安装oracle数据时需要用到图形界面安装,当我们用root用户登录后切换到oracle用户时运行./runInstaller提示报错: Can't connect to X11 window ser ...

  8. Android--MP3播放器MediaPlayer

    前言 Android提供了常见的音频.视频的编码.解码机制.借助于多媒体类MediaPlayer的支持,开发人员可以很方便在在应用中播放音频.视频.本篇博客主要讲解在Android平台下如何播放一个音 ...

  9. [解决方案]SystemError: Parent module '' not loaded, cannot perform relative import的解决方案

    缺陷:__mian__不能使用相对导入 PEP 328 Relative Imports and __name__ 中说明: Relative imports use a module's __nam ...

  10. [十七]基础类型BigDecimal简介

      BigDecimal是不可变的.任意精度的.有符号的.十进制数.   组成部分 BigDecimal 由任意精度的整数非标度值 和 32 位的整数标度 (scale) 组成 BigDecimal ...