建立本地仓库
git init
查看用户名和邮箱地址:
git config user.name
git config user.email
修改用户名和地址
git config --global user.name "your name"
git config --global user.email "your email"
git branch 查看当前分支
git checkout -b 新分支名 (创建并切换到分支下)
删除当前git版本库信息(一般不建议删除,除非提交新的地址和项目)
git remote remove origin
查看当前提交地址
git remote -v
git commit告诉Git,把文件提交到仓库
git status来查看是否还有文件未提交
第一步:是使用 git add 把文件添加进去,实际上就是把文件添加到暂存区。git add readme.txt(文件名) git add .添加所有文件
第二步:使用git commit提交更改,实际上就是把暂存区的所有内容提交到当前分支上。git commit -m '这里写上注释'
git remote add origin https://github.com/tugenhua0707/testgit.git 添加到新的仓库上面
已有git地址情况下,修改新的git地址:git remote set-url origin [email protected]:xuweixiao/vue-pc.git
克隆代码:git clone 项目地址
git pull把远程最新资源拉到本地库进行合并,如果有冲突的话得手动解决
git pull origin dev(master 主分支) 合并分支
git push -u origin master 把本地库的内容推送到远程
从现在起,只要本地作了提交,就可以通过如下命令:
git push origin master
git常用命令和使用步骤
猜你喜欢
转载自blog.csdn.net/qq_38847914/article/details/103367926
今日推荐
周排行