git checkout .丢弃本地修改git remote -v查看远程仓库地址和名称git branch -r查看所有远程分支列表git branch查看本地分支git branch -a查看所有分支列表(远程&本地)git checkout -b 本地分支名 origin/远程分支名拉取远程分支并创建本地分支git fetch origin 远程分支名:本地分支名拉取远程分支到本地分支,无关联分支git branch -D <branch_name>删除本地分支git push origin --delete <branch_name>删除远程仓库中的分支- 分支合并
-
切换到目标分支 git checkout target_branch 合并源分支到目标分支 git merge source_branch
git log查看历史提交记录git reset --hard [commit hash值]回滚到指定节点,不保留当前修改