• git and github 使用之个人


    配置信息 git config --global user.name git config --global user.email

    git status

    提交 git add filename(工作区提交到缓存区) git add .提交所有文件 git commit(缓存区提交到版本库,会打开记事本写注释) git commit -m直接写注释 git commit -a -m先提交到暂存区,再到版本库

    git log 按q退出

    对比 git diff(工作区与缓存区的对比) git diff --cached(缓存区与版本库的对比) git diff master(工作区与版本库的对比)

    撤销 git reset HEAD filename(缓存区还原工作区) git checkout -- filename(Z工作区还原) git commit --amend(撤销上次提交,合并提交)

    删除 git rm filename(删除缓存区的文件,但要先删除工作区的文件) git rm -f filename(直接删除缓存区和工作区的文件) git rm --cached filename(删除缓存区的文件,保留工作区的)

    还原 git checkout commitid filename还原单个 git reset --hard commitid还原所有 git reset --hard HEAD^自动还原上个版本 git reset --hard HEAD~数字 还原指定版本 git reflog 查看最近的动作

    同步到远程仓库 git remote查看仓库名字 git remote -v 查看仓库对应的名字 git push name master(分支)

    拉取仓库 git clone url

    多人协作解决冲突 git fetch不自动合并 git diff master origin/master git merge origin/master合并 git pull自动合并

    开源项目协作 fork克隆一个版本,放到自己的名下 pull request

    git分支 git branch查看分支 git branch new1创建分支 git checkout new1切换分支 git checkout -b new2创建分支并企切换 git merge new1

    git branch --merged查看分支合并情况 git branch --no-merged查看没有分支合并情况 git branch -d new1删除分支,要这个分支先合并 git branch -D new1删除分支,这个分支可以没有分支

    git标签 git tag v1.0打标签

  • 相关阅读:
    python 之字符编码
    python文件处理
    迭代器和生成器
    内置函数和匿名函数
    函数之递归
    函数 之装饰器
    python 函数进阶与闭包
    python 之 函数
    python之运算符
    python字符串内置方法
  • 原文地址:https://www.cnblogs.com/masita/p/5185689.html
Copyright © 2020-2023  润新知