美文网首页
git 各种问题

git 各种问题

作者: e0c52543163a | 来源:发表于2019-01-22 21:23 被阅读0次

    https://www.cnblogs.com/cxk1995/p/5800196.html

    echo "# draglayout" >> README.md
    git init
    git add README.md
    git commit -m "首次提交"
    
      git config --global user.email "xxxx@qq.com"
      git config --global user.name "Your Name"
    
    
    git remote add origin https://github.com/wx85278161/draglayout.git
    git push -u origin master
    //or push an existing repository from the command line
    git remote add origin https://github.com/wx85278161/draglayout.git
    git push -u origin master
    

    今天使用git 添加远程github仓库的时候提示错误:fatal: remote origin already exists.

    最后找到解决办法如下:
    1、先删除远程 Git 仓库
    git remote rm origin 2、再添加远程 Git 仓库git remote add origin https://gitee.com/wx85278161/go-iris

    git remote add origin https://gitee.com/wx85278161/go-iris

    如果你的本机是安装成功第一次使用,先配置一下一些基本的信息

    git config --global user.name "XXXX@qq.com" git config --global user.email "XXXX@qq.com"

    一、在码云上创建项目名称为demo的项目

    二、打开GitBash ,用cd命令进入本地项目目,然后把初始化一下,把本地的目录变成git本地仓库, git status 可以查看本地目录的状态信息

    git init

    git status

    三、将你本地仓库与码云上的远程仓库关联起来

    git remote add origin https://gitee.com/wx85278161/go-iris.git

    四、在你准备上传你的项目之前,最好更新一下项目,确保没有和远程仓库的代码有冲突

    git pull --rebase origin master

    五、把你的项目复制到这个目录下,用命令添加你要上传的项目,再提交到本地暂存区,最后把本地仓库项目提交到远程仓库。git 是强烈建议你在提交代码的时候,要写备注注释的,所以既然人家是强烈建议,你就别懒了。

    git add . 添加目录下所有发生改变的文件

    git commit -m '注释信息'

    git push -u origin master 本地仓库代码提交至远程仓库

    六、新建一个目录,从码云上把上传的代码下载下来:

    git clone https://gitee.com/xxxxx/demo.git

    ######################################

    remote: Incorrect username or password ( access token )

    打开电脑的控制面板–>用户账户–>管理Windows凭据

    相关文章

      网友评论

          本文标题:git 各种问题

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