下载代码:
在一个新建一个文件夹,cmd(git bash)
git clone URL(eg:)https://gitee.com/rookie-white/media/tree/master/
提交代码
git add .
git commit -m “描述”
git push
$ git config -global user.name <name> #设置提交者名字
$ git config -global user.email <email> #设置提交者邮箱
$ git config -global core.editor <editor> #设置默认文本编辑器
$ git config -global merge.tool <tool> #设置解决合并冲突时差异分析工具
$ git config -list #检查已有的配置信息
$ git add . #添加所有改动过的文件
// 如果想忽略某个文件,需要新建一个.gitignore文件,写入想忽略的文件名称
$ git add <file> #添加指定的文件
$ git mv <old> <new> #文件重命名
$ git rm <file> #删除文件
$ git rm -cached <file> #停止跟踪文件但不删除
$ git commit -m <file> # 提交指定文件
$ git commit -m “commit message” #提交所有更新过的文件
$ git commit -amend # 修改最后一次提交
$ git commit -C HEAD -a -amend #增补提交(不会产生新的提交历史纪录)
// 一次完整的操作 例 1、git add filename
2、git commit -m filename
删除例 1、$ vim abc.txt //先创建一个文件 //创建完之后如果不提交,git rm filename是无法操作的
2、$ git add abc.txt //提交
3、$ git commit abc.txt //上传
hint: Waiting for your editor to close the file... 会打开一个文件,图2.3
4、$ git rm abc.txt -f //强制删除