Git学习  [draft]

环境 Windows 10 git bash git配置 1 2 3 4 5 6 7 8 # 查询git版本 git --version # 查看当前电脑的git用户配置 git config --list # 设置git全局用户名 git config --global user.name "DyedBamboo" # 配置邮箱 git config --global user.email "xxxxxxx@qq.com" 实例操作 本地仓库操作 随便找个位置新建文件夹,命名GitLearing,进入GitLearning右键"Git Bash Here" 把这个文件夹作为工作区,就可以在这个文件夹下放自己的代码了 例如我这里新建了两个文件:helloworld.cpp,helloworld.py 运行 git status查看当前工作区状态,显示有两个文件helloworld.cpp和helloworld.py未提交到缓存区。然后运行git add .把当前目录下的所有文件添加到缓存区 接着运行git commit -m "添加了Cpp和Python的HelloWord"提交到仓库 更改代码文件内容后重新提交git add ., git commit -m "修改了两个文件",然后运行git log查看提交历史...

July 29, 2022 · 1 min · 染竹君