• 高效使用git的一些命令


      1,添加文件到版本库
            添加单个文件: git add filename
            添加所有txt文件: git add *.txt
            添加所有修改文件: git add .
      2,提交
            提交所有修改: git commit -m "commit msg" -a
            提交单个修改: git commit -m "commit msg" filename
            修改commit信息: git commit --amend
      3,撤销修改
            撤销尚未提交的修改: git checkout 1.txt 2.txt
            撤销提交: git revert head(反转提交,撤销最近一次的提交并且会产生一个新的commit信息)
            复位: git reset HEAD filename(取消暂停)
                git reset --hard HEAD^(撤销)
      4,分支
            列出本地分支: git branch
            列出所有分支: git branch -a
            基于当前分支创建新分支: git branch branchcname
            切换分支: git checkout branchname
            基于当前分支创建新的分支并且切换到新的分支: git checkout -b branchname
            基于某次提交,分支或者tag创建分支: git branch branchname bf357de
                                                                                              git branch branchname tagname
      5,合并
            普通合并: git merge branchname
            挑选合并: git cherry-pick bf357de
            压缩合并: git merge --squash branchname
            其它: git rebase branchname
            reabse: git rebase -i

      6,删除分支
            git branch -d branchname
            git branch -D branchname(强制删除分支)
      7,查看状态
            git log --oneline --graph
            gitk 查看当前分支历史
            gitk branchname 查看特定分支历史
            gitk -all 查看所有分支历史
            gitk filename 查看某文件的历史记录
      8,remote
            git clone
            git pull origin branchname
            git push origin branchname
            git push origin tagname
      9,config
            生成ssh密钥: ssh-keygen.exe -t rsa
            配置邮箱: git config --global user.email *****.com
            配置用户名: git config --global user.name your-id

  • 相关阅读:
    如何编辑SDE数据(转)
    常用sql语句
    JavaScript 实现地图打印
    什么是3G通信?
    一种客户端得到后台某个值的方法
    如何利用C#创建和调用DLL(转)
    C#中如何调用动态链接库DLL(转)
    一个ADF Javascript 添加鼠标移动事件的例子
    ArcGIS Server网站发布后地图显示空白的原因
    硬盘录像机监听按钮不起作用
  • 原文地址:https://www.cnblogs.com/jones-c/p/3863560.html
Copyright © 2020-2023  润新知