1:前提下载好Git

2:在电脑上创建一个文件夹,打开此文件夹,单击右键—〉 git bash here

3:输入git init

完成后会在此文件夹下生成一个隐藏的.git后缀文件

4:将你的代码添加并提交到本地仓库

git add .  ----> 所有文件

或 git add 《文件名》

git commit -m "项目描述"

5:将仓库代码推到线上coding(需要先获取远程仓库地址)

git remote add origin https:// git.coding.net/用户名/项目名.git

git push origin master

问题:

需要账号和密码

2:出现如下错误

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.

方法:

1:git pull

Administrator@Jassin MINGW64 ~/Desktop/git (master)
$ git pull
warning: no common commits
remote: Counting objects: , done.
remote: Compressing objects: % (/), done.
remote: Total (delta ), reused (delta )
Unpacking objects: % (/), done.
From https://git.coding.net/dujassin/fristdemo
* [new branch] master -> origin/master
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull() for details. git pull <remote> <branch> If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/<branch> master

2:操作如上提示:

 git pull <remote> <branch>
$ git pull --rebase origin master
From https://git.coding.net/dujassin/fristdemo
* branch master -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Applying: one

再:

$ git push -u origin master


 

使用git将代码推到coding的更多相关文章

  1. 使用 git 将代码推送到多个仓库

    使用 git 将代码推送到多个仓库 起因     起初,在 GitHub 建了一个仓库,200+ 的 commits .后来(终于在眼泪中明白...误

  2. Git 将本地代码推到 Coding 远程仓库

    1 首先创建文件夹,将要推的项目文件夹拷贝过来,进入文件夹 右键 Git Bash Here 输入以下代码 把这个目录变成git管理的仓库 git init 2 把文件添加到版本库中,使用命令 git ...

  3. 将已有Git库代码推送到新建库中

    cd /path/to/your/git/repo/ git remote -v git remote rm origin git remote add origin ssh://abc@gmail. ...

  4. coding上创建项目、创建代码仓库、将IDEA中的代码提交到coding上的代码仓库、Git的下载、IDEA上配置git

    文章目录 一.Git的安装以及子啊IDEA上配置Git(下载好的可以跳过) 二.怎样让IDEA和Git建立关系 三.在coding上创建项目 四.在coding上创建代码仓库 五.Git工作理论 六. ...

  5. git 提交代码的流程

    [root@ok-T IT-DOC]# ls hx-海星-wifi.rd web收藏.txt [root@ok-T IT-DOC]# git status -s ?? "web\346\22 ...

  6. 1. Git 克隆代码

    1. Git 克隆代码 git clone git://github.com/facebook/hiphop-php.git 2. Git更新分支 查看服务器上的所有分支 [huzg@slave3 h ...

  7. Git版本控制:Gitlab及Coding.net的使用

    http://blog.csdn.net/pipisorry/article/details/50709014 Gitlab介绍 GitLab是利用 Ruby on Rails 一个开源的版本管理系统 ...

  8. git提交代码五部曲

    From: https://jingyan.baidu.com/article/359911f5a4fe4b57fe03060d.html 正常使用git时,提交代码五部曲. 工具/原料   电脑 已 ...

  9. Git提交代码失败: empty ident name (for <>) not allowed

    使用git提交代码,报错如下: 下午2:56 Commit failed with error 0 files committed, 1 file failed to commit: 升级 empty ...

随机推荐

  1. Shell学习小结 - 深入认识变量

    移动端访问不佳,请访问我的个人博客 变量的命名 对于初学者来说,可以简单的理解为,变量就是保存在计算机内存中的一系列的键值对. 列如: str="hello" 这里的str就是变量 ...

  2. HikariPool-1 - Exception during pool initialization.

    java.sql.SQLNonTransientConnectionException: CLIENT_PLUGIN_AUTH is required 这是由于springboot自带 mysql-c ...

  3. LeetCode——Edit Distance

    Question Given two words word1 and word2, find the minimum number of steps required to convert word1 ...

  4. Python基础笔记系列七:字符串定义和访问

    本系列教程供个人学习笔记使用,如果您要浏览可能需要其它编程语言基础(如C语言),why?因为我写得烂啊,只有我自己看得懂!! 字符串定义和访问 1.字符串基础 a.字符串可以用单引号.双引号.三引号( ...

  5. php调用mysql存储过程

    MYSQL存储过程 原文链接:http://blog.sina.com.cn/s/blog_52d20fbf0100ofd5.html 一.存储过程简介(mysql5.0以上支持) 我们常用的操作数据 ...

  6. mysql数据库优化课程---14、常用的sql技巧

    mysql数据库优化课程---14.常用的sql技巧 一.总结 一句话总结:其实就是sql中那些函数的使用 1.mysql中函数如何使用? 选择字段 其实就是作用域select的选择字段 3.转大写: ...

  7. Python之NumPy中线性代数

    参考博客:http://blog.csdn.net/u013930163/article/details/51839983 网站:https://docs.scipy.org/doc/numpy-de ...

  8. ngnix配置自解

    全局配置 user [user] [group]; #只有被设置为用户或用户组的成员才有nginx的启动权限.(#user nobody nobody <=> user nobody no ...

  9. 快速切题 poj 1003 hangover 数学观察 难度:0

    Hangover Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 103896   Accepted: 50542 Descr ...

  10. centos 7 nginx 远程无法访问的原因

    1.购买的阿里云需要添加安全组 80端口就可以用了 2.检查防火墙是否关闭 systemctl stop firewalld 这点很重要 我就是查了一天才发现centos7 防火墙开着 难怪几把搞 如 ...