做家政建网站,seo网站关键词排名优化,网站开发 程序开发原理,个人网站实例保证
首先保证自己的git已经下载 其次保证自己的gitee账号已经安装并且已经生成ssh公钥 保证自己要push的代码在要上传的文件夹内并且配置文件等都在父文件夹#xff08;也就是文件没有套着文件#xff09;
问题
1
$ git push origin master
gitgitee.com: Permission de…保证
首先保证自己的git已经下载 其次保证自己的gitee账号已经安装并且已经生成ssh公钥 保证自己要push的代码在要上传的文件夹内并且配置文件等都在父文件夹也就是文件没有套着文件
问题
1
$ git push origin master
gitgitee.com: Permission denied (publickey).
fatal: Could not read from remote repository.Please make sure you have the correct access rights
and the repository exists.
伤命提示的很清楚 没公钥 publickey
2
$ git commit -m 123
On branch master
nothing to commit, working tree clean
这个消息表示在提交之前你的工作目录中的某个文件被修改但还没有添加到暂存区。在使用 git commit 命令提交更改之前你需要先将修改的文件添加到暂存区。
需要add
3
$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, usegit push --set-upstream origin masterTo have this happen automatically for branches without a tracking
upstream, see push.autoSetupRemote in git help config.
ssh密钥没配置 看下面的密钥配置步骤跟着来
4
$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, usegit push --set-upstream origin masterTo have this happen automatically for branches without a tracking
upstream, see push.autoSetupRemote in git help config.
使用 git push origin master
5
$ git commit -m 修改2
On branch master
nothing to commit, working tree clean
没有提交之前的代码 先把之前的提交了 git push
gitee配置流程
安装git
进入gitee官网进行注册
新建远程仓库 新建之后我们可以看到跳转到这个页面 帮助我们在本地配置仓库 在任意一个文件夹或者桌面鼠标右键进入git 命令行 进入之后按照步骤进行配置用户名邮箱 直接照搬人家给的用户名就行 那就是你自己的用户名邮箱 在命令行中使用 git config --global user.name “你的名字” git config --global user.email “你的邮箱qq.com” 然后找到你想安装的仓库位置重新进入git命令行 mkdir 官方给的名字 //新建文件夹 cd 官方给的名字 //进入文件夹目录下 git init //初始化 touch README.md git add README.md git commit -m “first commit” git remote add origin 你的远程仓库的ssh链接//这个远程仓库链接就是打开gitee然后点开右边的按钮复制你的ssh链接
git push -u origin “master”
可以看到你的readme文件已经推送到分支了
配置ssh密钥
在gitee中进入设置 然后在你的命令行中输入$ ssh-keygen -t ed25519 -C “你的邮箱qq.com” 可以看到返回的这样的提醒 去相应的文件夹找到 的.pub文件 用记事本打开 复制里面的所有内容到刚刚gitee的生成密钥的地方 复制进去上面随便起名字 我用的是tests作为名字 可以有多个ssh密钥
然后在git命令行中输入 $ ssh -T gitgitee.com 测试如果有successfully就说明成功了 然后在命令行中加入你的代码
注意代码要尽量不要在文件夹内 项目代码直接在最外层代码
推送代码
git add .//注意.之前有个空格 git commit -m “测试”//这个测试随便起 等到了团队开发的时候要商定最终起什么名字 $ git push origin master //推送代码到master分支 进入gitee就能看到自己的代码了
更新代码
git add 更新的代码 git commit -m “修改1” 注意添加之后一定要提交 不然别的就提交不了也不能进行add了 git push origin master 打开gitee就能看见修改1 了
vscode使用git
https://zhuanlan.zhihu.com/p/658247945 安装之后打开本地仓库 点开最左边应用栏的git插件
从终端旁边看看git仓库记录
随便修改一下你的代码
可以看到你的更改 点击提交 进入一个说明文件 里面可以写上你的更新代码的实现功能 注意写的时候不要写在#后面 点击右上角的对勾
然后点击同步更改 可以看到自己的推送记录 这里可以看到我刚刚写的修改日志