Git常用命令

来源:互联网 发布:网络大电影如何立项 编辑:程序博客网 时间:2024/05/17 22:56
Git放弃所有本地修改:
  git checkout .  #本地所有修改的、没有提交的,都返回到原来的状态
  git stash    #把所有没有提交的修改暂存到stash里面。可用git stash pop回复。
  git reset --hard HASH #返回到某个节点,不保留修改。
  git reset --soft HASH #返回到某个节点。保留修改

Git获取远程新分支:【两步操作】
  1、git fetch origin new_branchname
  2、git checkout -b local_branchname origin/remote_branchname
    这样就可以将远程分支映射到本地命名为local_branchname的一个新分支



原创粉丝点击