1.新建代码仓库

2.生成密钥

ssh-keygen -C 'your@email.address' -t rsa

3.到根目录下的.ssh文件夹下找到id_rsa.pub文件,将里面的内容复制到下图所标的位置

4.在Git shell下输入ssh -T git@github.com测试刚才上传的公钥是否正确

正确时会显示:

Hi "Your Name"! You've successfully authenticated, but GitHub does not provide shell access.

5.赋值刚创建的代码仓库的地址,把仓库内容clone到本地

git clone https://github.com/YangXudongJack/JYMenuview.git

6.这样就把代码clone到了本地,然后找到仓库文件,把要提交的代码文件copy到里面

7.切到Git shell下输入命令

git init

git commit -m 'JYMenuview'

git remote add origin https://github.com/YangXudongJack/JYMenuview.git

git push origin master

(1)如果执行git commit -m 'JYMenuview'报错提示

On branch master

Your branch is up-to-date with 'origin/master'.

Untracked files:

JYMenuview.xcodeproj/

JYMenuview/

JYMenuviewTests/

JYMenuviewUITests/

nothing added to commit but untracked files present

则执行git add jymenuview.xcodeproj/,把提示的文件都加入到仓库的管理目录下

(2)如果执行git remote add origin

https://github.com/Flowerowl/stumansys.git

,出现错误:

  fatal: remote origin already exists

则执行以下语句:

  git remote rm origin

再往后执行git remote add origin https://github.com/Flowerowl/stumansys.git 即可。

(3)在执行git push origin master时,报错:

  error:failed to push som refs to.......

则执行以下语句:

  git pull origin master

先把远程服务器github上面的文件拉下来,再push 上去。

第一次用Github desktop(mac)提交代码遇到的问题的更多相关文章

  1. github通过token提交代码

    github通过token提交代码 生成token 个人头像->Setttings->Developer settings->Personal access tokens->G ...

  2. Mac 提交代码到Github

    然后在GitHub上创建版本库(Repository),在GitHub首页上,点击“Create a New Repository”,如下所示(为了便于后面演示,创建README.md这步暂不勾选): ...

  3. Github远程仓库提交代码步骤

    1.克隆远程仓库     1)当没有设置默认目录时         git clone 仓库地址 本地存放目录 //没有目录的情况    2)当设置了本地存放目录时         先打开路径,命令: ...

  4. 使用git bash向github远程仓库提交代码

    1.登录github,创建仓库. 2.切换到要提交的文件目录下. 3.打开git bash 3.1.初始化仓库 git init 3.2.将本地仓库与远程仓库关联 git remote add ori ...

  5. 使用git提交代码到GitHub

    0.下载Git Bash,在Windows系统可以用Git Bash通过简单的命令将代码提交到GitHub1.打开项目所在的文件夹,右键,"Git Bash Here"2.初次使用 ...

  6. IDEA提交代码到github

    GIT客户端安装及idea配置github账号并提交代码到GIT参考资料:https://blog.csdn.net/qq_31405633/article/details/88193119 1. 选 ...

  7. 提交代码到github

    1. 下载git 点击download下载即可.下载地址:https://gitforwindows.org/ 2. 注册github github地址:https://github.com/ 一定要 ...

  8. github 上传下载代码简单使用

    很长时间,一直认为github很难操作,其实认真学了发现也不是很困难. 主要就3个命令 git clone 建立空间 git push 提交代码,git pull拉取代码. git clone htt ...

  9. mac 使用命令行向 github 提交代码

    让 mac 本地和自己的 github 网站建立连接(ssh) 下载安装 git 网址: https://git-scm.com/downloads 查看安装是否成功: git -version $ ...

随机推荐

  1. 14.8.9 Clustered and Secondary Indexes

    14.8.9 Clustered and Secondary Indexes 每个InnoDB 表有一个特殊的索引称为 clustered index 用于存储数据. 通常, clustered in ...

  2. ASP.NET MVC 后台接收集合参数和 jquery ajax 传值

    MVC 接收参数数组(集合)   示例样本:   public class Person {      public string FirstName { get; set; }      publi ...

  3. .config-20150410

    ## Automatically generated file; DO NOT EDIT.# OpenWrt Configuration#CONFIG_MODULES=yCONFIG_HAVE_DOT ...

  4. ServiceStack.Redis 之 IRedisTypedClient

    IRedisTypedClient IRedisTypedClient类相当于IRedicClient的强类型版,其方法与属性大多数与IRedisClient类似. 它支持在Redis中使用Linq查 ...

  5. 搜索(剪枝优化):HDU 5113 Black And White

    Description In mathematics, the four color theorem, or the four color map theorem, states that, give ...

  6. codeforces --- 115A

    A. Party time limit per test 3 seconds memory limit per test 256 megabytes input standard input outp ...

  7. mysql数据库还原出错ERROR:Unknown command ‘\\’解决手记

    使用mysql命令行客户端,使用source导入备份文件,但导入中出错, ERROR: Unknown command ‘\\’. ERROR: Unknown command ‘\”. ERROR: ...

  8. socket programming Max size of tcp/ip socket Buffer?

    TCP data is buffered at both sender and receiver. The size of the receiver's socket receive buffer d ...

  9. 安装 PLSQL笔记

    安装 PLSQL Developer 1. 下载PLSQL Developer 安装文件.安装文件类型是exe,直接安装就可以. 这个时候打开PLSQL Developer ,打开 help –> ...

  10. hdoj 2196 Computer【树的直径求所有的以任意节点为起点的一个最长路径】

    Computer Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Su ...