Git 命令的相关使用整理

Git 命令的相关使用整理

git branch 本地所有的分支列表(List all existing branches)
git branch -a 远程所有的分支列表(List all existing branches)
git checkout dev 检出分支或者切换分支
git pull 在当前分支进行拉取远程内容
git commit -m 提交内容

git push 推送到远程

git status 查看工作区内的文件修改(List changed files in your working directory)

git add . 添加本地库中的所有修改在下次提交的时(Add all current changed to the next commit)
git commit -m 提交工作区所有文件(Commit all local changes in tracked files)

git stash 查看临时的文件变动 (Store changes temporarily)
git checkout 切换分支(Switch HEAD branch)

git branch 创建新分支(Creat a new branch based on your current HEAD)
git branch --track 创建一个新的分支基于一个远程的分支(Creat a new tracking branch based on a remote branch)

git branch -d 删除一个本地分支(Delete a local branch)
git branch origin --delete 删除一个远程分支(Delete a remote branch)
git push : 重命名远程分支名(Rename a branch on remote)git push
git push

git remote prune origin 更新远程删除的
git remote update origin --prune 更新远程添加的

当使用git提交代码时出现GIT error: The following untracked working tree files would be overwritten…的错误时候,可通过下面指令解决问题。git clean -d -fx

git clean -d -fx

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值