美文网首页
git hub提交

git hub提交

作者: 邱_sir | 来源:发表于2018-06-01 13:48 被阅读0次

git push -u origin master

To https://github.com/scottlove0519/Test.git

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

error: failed to push some refs to 'https://github.com/scottlove0519/Test.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.

提示出错信息:fatal: remote origin already exists.解决办法如下:

1、先输入$ git remote rm origin

因为提交的版本小于远程仓库中的版本。

git push -u origin master -f

添加帐号邮箱

$git config --global user.name 'scottlove0519'

$ git config --global user.email 512866393@qq.com

如码云:

$git config --global user.name 'qiuzhongwei0519'

$ git config --global user.email 512866393@qq.com

1.git init 

添加到栈缓区

2.git add .

提交到栈缓区

3.git commit -u

关联远程和本地

4.git remote add origin https://github.com/scottlove0519/GuoKongYiTiHua-0.5.git

提交到远程

5. git push -u origin master -f


修改之前提交的注释

git commit --amend

vim修改后保存退出

git rebase --continue

git push -u origin master -f

Please make sure you have the correct access rights

ssh key问题

1、首先我得重新在git设置一下身份的名字和邮箱(因为当初都忘了设置啥了,因为遇到坑了)进入到需要提交的文件夹底下(因为直接打开git Bash,在没有路径的情况下,根本没! 法! 改! 刚使用git时遇到的坑。。。 )

git config --global user.name "yourname"

git config --global user.email“your@email.com"

注:yourname是你要设置的名字,your@email是你要设置的邮箱。

2、删除.ssh文件夹(直接搜索该文件夹)下的known_hosts(手动删除即可,不需要git)

3、git输入命令

$ ssh-keygen -t rsa -C "your@email.com"(请填你设置的邮箱地址)

接着出现:

Generating public/private rsa key pair.

Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa):

请直接按下回车

然后系统会自动在.ssh文件夹下生成两个文件,id_rsa和id_rsa.pub,用记事本打开id_rsa.pub

将全部的内容复制

4、打开https://github.com/,登陆你的账户,进入设置

进入ssh设置

点击add ssh key,

ok!

5、在git中输入命令:

ssh -T git@github.com

然后会跳出一堆话。。

输入命令:yes

回车

然后就会提示你成功了~~

相关文章

  • git hub提交

    git push -u origin master To https://github.com/scottlove...

  • react-native-vector-icons 矢量图标的使

    资源 git hub地址作者git hub,有诸多UI资源 安装 此时将在"../../node_modules/...

  • git hub 和 git lab相比哪个更好?该如何选择?

    ​ git hub 和 git lab相比哪个更好?该如何选择? 这一期呢,我们来说一下git hub和git l...

  • git hub

    注册 用谷歌浏览器进入官网注册https://github.com/join?source=header-home...

  • 转移

    发现git-hub是个好东西,简书断更!! 有兴趣可关注[git-hub](https://github.com/...

  • docker推送本地镜像

    在docker hub上传镜像 类似于git hub ,docker hub是docker公司提供的一个线上镜像寄...

  • GIT命令

    新建路径: git clone 提交修改: git add . 本地提交: git comm...

  • Git Hub 笔记

    刚看完入门视频: http://www.imooc.com/learn/390 Git Hub注册了很久 一直放在...

  • git hub使用

    1.注册 GitHub 账号, 把github用户名发送给老师 JRG-zhangshijun 2.看Git...

  • 2017-06-18

    掌握一个技能,学会使用git hub

网友评论

      本文标题:git hub提交

      本文链接:https://www.haomeiwen.com/subject/ioobjftx.html