参考自网上还有码云,大致做个记录方便忘记了查看
克隆项目
$ git clone https://gitee.com/用户个性地址/HelloGitee.git #将远程仓库克隆到本地
配置帐号邮箱
$ git config --global user.name "你的名字或昵称"
$ git config --global user.email "你的邮箱"
拉取代码(从远程的origin仓库的master分支下载到本地master并新建一个temp分支,不会合并)
git fetch origin master:temp
拉取代码(会合并)
$ git pull origin master
提交代码
$ git add . #将当前目录所有文件添加到git暂存区
$ git commit -m "my first commit" #提交并备注提交信息
$ git push origin master #将本地提交推送到远程仓库
建立仓库与本地关联或修改仓库地址
$ git init
$ git remote add origin https://gitee.com/用户个性地址/HelloGitee.git
将当前改动暂存起来:
git stash
恢复最后一次暂存的改动
git stash pop
查看有多少暂存
git stash list
撤销当前的修改:
git reset --hard