# cd1008.b **Repository Path**: uptocoding/cd1008.b ## Basic Information - **Project Name**: cd1008.b - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2022-04-19 - **Last Updated**: 2022-08-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 学员每日笔记和代码同步仓库 ### 1.要求 + 每天睡前,将 当天的 笔记和代码 同步到本仓库 + 注意:要求,必须 同步 用自己的名字 命名的文件夹 ### 2.操作命令 + 老师的操作:初始化远程仓库和内容 + **远程仓库页面:**https://gitee.com/uptocoding/cd1008.b ``` js // 1.在 本地 添加 远程仓库的 地址 // git remote add 仓库别名 远程仓库地址 git remote add origin git@gitee.com:uptocoding/cd1008.b.git // 2.将初始文件添加到本地仓库 git add . // 提交到 本地暂存区 git commit -m'项目初始化' // 提交到 本地仓库区 // 3.将本地仓库 推送到远程仓库 git push -u origin master ``` ### 3.学员操作1-设置https地址 + 学员操作,需要 选择使用 两种 验证方案:https(通过用户名密码登录) or ssl(通过配置公钥私钥来登录) + 初学者 用 https 登录就好了 + 需要先 向本地仓库中添加 https 地址 `git remote add orgin2 https地址 ` + ![image-20220419171702625](assets/image-20220419171702625.png) + 检查 本地仓库中保存的 远程地址列表 ![image-20220419171755590](assets/image-20220419171755590.png) + 推送时,使用https地址 `git push -u orign2 master` + 会提示输入 用户名和密码(主邮箱和密码) + 如果正确,则 会将 最新版本代码 提交到 远程仓库 + 如果错误,则 会显示 失败 ![image-20220419171938060](assets/image-20220419171938060.png) + 需要重新提交,重新提示输入 用户名 和密码 + 正确提交后,用户名和密码 会被保存到 **【凭据管理器】** ![image-20220419171546421](assets/image-20220419171546421.png) ### 4.学员的拉取和提交操作 + 直接克隆到本地(包含代码文件和当前远程仓库地址) ```js // 1.克隆 老师的 远程仓库 到本地 // 注意:克隆就是将远程仓库的代码和地址 复制到 当前目录 git clone git@gitee.com:uptocoding/cd1008.b.git ``` + 学员今后每天提交时的操作: ```js // 1.先拉取远程仓库到本地(确保拥有远程仓库最新的文件代码) git pull // -----------------编写代码和学习笔记文档------------ // 2.将修改后的代码文件添加到本地仓库 git add . // 提交到 本地暂存区 git commit -m'项目初始化' // 提交到 本地仓库区 // 3.在确保文件没有冲突的情况下,再将本地仓库最新文件代码推送到 远程仓库 // 3.1 首次推送 git push -u origin2 master // 3.2 之后推送 可以省略 git push ``` ![image-20220419172150142](assets/image-20220419172150142.png) ### 5.地址操作命令 ![image-20220419181846504](assets/image-20220419181846504.png)