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]LeetCode450. 删除二叉搜索树中的节点 | Delete Node in a BST

    Given a root node reference of a BST and a key, delete the node with the given key in the BST. Retur ...

  2. [Swift]LeetCode581. 最短无序连续子数组 | Shortest Unsorted Continuous Subarray

    Given an integer array, you need to find one continuous subarray that if you only sort this subarray ...

  3. [Swift]LeetCode732. 我的日程安排表 III | My Calendar III

    Implement a MyCalendarThree class to store your events. A new event can always be added. Your class ...

  4. [Swift]LeetCode733. 图像渲染 | Flood Fill

    An image is represented by a 2-D array of integers, each integer representing the pixel value of the ...

  5. [Swift]LeetCode850. 矩形面积 II | Rectangle Area II

    We are given a list of (axis-aligned) rectangles.  Each rectangle[i] = [x1, y1, x2, y2] , where (x1, ...

  6. 优化之XML组件

    可在XML Parser 组件和XML Source定义中删除非project group,因为不需为这些非project group分配内存,但需要维护主键外键约束 ________________ ...

  7. mac openresty 源码安装 坑

    下载openresty源码安装 下载页面http://openresty.org/cn/download.html 下载上一个版本的稳定版 https://openresty.org/download ...

  8. 死磕 java集合之TreeMap源码分析(三)- 内含红黑树分析全过程

    欢迎关注我的公众号"彤哥读源码",查看更多源码系列文章, 与彤哥一起畅游源码的海洋. 删除元素 删除元素本身比较简单,就是采用二叉树的删除规则. (1)如果删除的位置有两个叶子节点 ...

  9. 『Balancing Act 树的重心』

    树的重心 我们先来认识一下树的重心. 树的重心也叫树的质心.找到一个点,其所有的子树中最大的子树节点数最少,那么这个点就是这棵树的重心,删去重心后,生成的多棵树尽可能平衡. 根据树的重心的定义,我们可 ...

  10. JS 中 原生方法 (一) --- 字符串

    目录 Javascript 中 str. arr.date.obj 等常见的原生方法总结 Javascript 中 str. arr.date.obj 等常见的原生方法总结 本文也说主要阐释了 Jav ...