git 实用操作
1.从一个commit节点拉出一个分支
a.切到commit_id
// commit_id 提交节点
git checkout commit_id
b. 创建新分支
// new_branch_name 新拉分支的名字
git checkout -b new_branch_name
c. 推送到远程
// new_branch_name 新拉分支的名字
git push -u origin new_branch_name
2.当前分支代码回滚到指定commit节点
a.本地代码回滚到指定提交节点文章来源:https://www.toymoban.com/news/detail-503061.html
// commit_id 提交节点
git reset --hard commit_id
b.提交到仓库文章来源地址https://www.toymoban.com/news/detail-503061.html
git push -f
到了这里,关于git 从一个commit节点拉出一个分支,当前分支代码回滚到指定commit节点的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!