git中的一些问题

来源:互联网 发布:win10平板装ubuntu 编辑:程序博客网 时间:2024/06/16 07:08

在初步使用Git  的时候,会出现将本地项目添加到仓库中,在GitHub上创建好仓库之后,使用Github提供的命令进行对仓库的初始化


git init
git add '文件名'git commit -m "first commit"git remote add origin 自己项目的地址git push -u origin master
但是在使用git add '文件名字' ,git commit -m '添加备注' ,git -push 进行添加的时候,出现这样的错误
  git config --global push.default matchingTo squelch this message and adopt the new behavior now, use:  git config --global push.default simpleWhen push.default is set to 'matching', git will push local branchesto the remote branches that already exist with the same name.Since Git 2.0, Git defaults to the more conservative 'simple'behavior, which only pushes the current branch to the correspondingremote branch that 'git pull' uses to update the current branch.See 'git help config' and search for 'push.default' for further information.(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode'current' instead of 'simple' if you sometimes use older versions of Git)fatal: The current branch master has no upstream branch.To push the current branch and set the remote as upstream, use    git push --set-upstream origin masterbash: warning:: command not foundbash: its: command not found
出现这种情况,可能电脑上的公钥和仓库中的公钥没有进行匹配,主要在本地中生成公钥。
然后在github上将自己的公钥添加进去。
在使用 git push -u origin master 命令进行上传就可以啦。
原创粉丝点击