首页
statistical
wallpaper
Search
1
Serv00虚拟主机
385 阅读
2
Azure 100(AZ100) 学生申请
316 阅读
3
项目搭建
277 阅读
4
Raft论文研读 Ⅳ
257 阅读
5
Raft论文研读 Ⅱ
256 阅读
Java
VPS
BlockChain
Paper
Other
备战
登录
Search
标签搜索
Raft
VPS
Java
共识算法
区块链
论文
项目搭建
Docker
改进Raft
SE
Web
Git
SSM
Spring Boot
Blog
Nat
科学上网
ChatGpt
探针
AZ100
ZhenXI
累计撰写
35
篇文章
累计收到
12
条评论
首页
栏目
Java
VPS
BlockChain
Paper
Other
备战
页面
statistical
wallpaper
搜索到
1
篇与
的结果
2022-07-31
Git
1 Git基本配置当安装Git后首先要做的事情是设置用户名称和email地址。这是非常重要的,因为每次Git提交都会使用该用户信息。打开Git Bash设置用户信息git confifig --global user.name “itcast” git confifig --global user.email “hello@itcast.cn”查看配置信息git confifig --global user.name git confifig --global user.email2 创建本地仓库要使用Git对我们的代码进行版本控制,首先需要获得本地仓库:1)在电脑的任意位置创建一个空目录(例如test)作为我们的本地Git仓库。2)进入这个目录中,点击右键打开Git bash窗口。3)执行命令git init。4)如果创建成功后可在文件夹下看到隐藏的.git目录。git init3 基础git操作命令77339@LAPTOP-59ARH7U0 MINGW64 ~/Desktop/test/.git (GIT_DIR!) $ cd .. 77339@LAPTOP-59ARH7U0 MINGW64 ~/Desktop/test (master) $ touch file.txt 77339@LAPTOP-59ARH7U0 MINGW64 ~/Desktop/test (master) $ git status On branch master No commits yet Untracked files: (use "git add <file>..." to include in what will be committed) file.txt nothing added to commit but untracked files present (use "git add" to track) 77339@LAPTOP-59ARH7U0 MINGW64 ~/Desktop/test (master) $ git add . 77339@LAPTOP-59ARH7U0 MINGW64 ~/Desktop/test (master) $ git status On branch master No commits yet Changes to be committed: (use "git rm --cached <file>..." to unstage) new file: file.txt 77339@LAPTOP-59ARH7U0 MINGW64 ~/Desktop/test (master) $ git commot -m "add file" git: 'commot' is not a git command. See 'git --help'. The most similar command is commit 77339@LAPTOP-59ARH7U0 MINGW64 ~/Desktop/test (master) $ git commit -m "add file" [master (root-commit) 36806c9] add file 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 file.txt 77339@LAPTOP-59ARH7U0 MINGW64 ~/Desktop/test (master) $ git status On branch master nothing to commit, working tree clean 77339@LAPTOP-59ARH7U0 MINGW64 ~/Desktop/test (master) $ git log commit 36806c9633d85f2200f9277c9a6b0b196780b866 (HEAD -> master) Author: studentliuchang <773395726@qq.com> Date: Fri Aug 12 16:11:31 2022 +0800 add file 77339@LAPTOP-59ARH7U0 MINGW64 ~/Desktop/test (master) $ vi file.txt 77339@LAPTOP-59ARH7U0 MINGW64 ~/Desktop/test (master) $ cat file.txt updata count01 =1 77339@LAPTOP-59ARH7U0 MINGW64 ~/Desktop/test (master) $ git status On branch master Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) modified: file.txt no changes added to commit (use "git add" and/or "git commit -a") 77339@LAPTOP-59ARH7U0 MINGW64 ~/Desktop/test (master) $ git add . warning: LF will be replaced by CRLF in file.txt. The file will have its original line endings in your working directory 77339@LAPTOP-59ARH7U0 MINGW64 ~/Desktop/test (master) $ git status On branch master Changes to be committed: (use "git restore --staged <file>..." to unstage) modified: file.txt 77339@LAPTOP-59ARH7U0 MINGW64 ~/Desktop/test (master) $ git commit -m "updata file01" [master e70b970] updata file01 1 file changed, 2 insertions(+) 77339@LAPTOP-59ARH7U0 MINGW64 ~/Desktop/test (master) $ git log commit e70b970b3b95354337b57fe8fb9b3eebe62ce293 (HEAD -> master) Author: studentliuchang <773395726@qq.com> Date: Fri Aug 12 16:15:01 2022 +0800 updata file01 commit 36806c9633d85f2200f9277c9a6b0b196780b866 Author: studentliuchang <773395726@qq.com> Date: Fri Aug 12 16:11:31 2022 +0800 add file 4 Git远程仓库在码云上创建仓库:验证密钥是否配置成功:ssh -T git@gitee.com # 添加远程仓库 git remote add <远端名称> <仓库路径> # 查看远程仓库 git remote # 推送到远程仓库 git push [-f] [--set-upstream] [远端名称 [本地分支名][:远端分支名] ]5 IDEA使用Git5.1 配置Git5.2 初始化本地仓库配置.gitignore文件:# IntelliJ project files .idea *.iml out gen /.apt_generated/ /.classpath /.factorypath /.project /.settings/ /.springBeans /target/ /.gitignore /user-profile-analysis.iml /.idea /README.md .DS_Store5.3 创建远程仓库5.4 更改提交5.5 克隆到本地修改后再次上传:创建分支:6 使用游戏学习Git地址:https://oschina.gitee.io/
2022年07月31日
34 阅读
0 评论
2 点赞