zoukankan      html  css  js  c++  java
  • git常用

    git常用命令

    1)

        git add a.txt   
        git status
    --------------------------------------------------------------
        On branch master
        Changes to be commited:
            (use "git reset HEAD <file>... to unstage)
                new file:     a.txt
        git reset HEAD a.txt    
    
        git status
    --------------------------------------------------------------
        On branch master
        Untracked files:
         (use "git add <file>..." to include in what will be commited)
            a.txt
         nothing added to commit bug untracked files present (use "git add" to track)
    

    2、冲突解决

    <<<<<<< HEAD
    	#要提交的内容
    =======
            #下拉的内容
    ">>>>>>> e59ca5b2fd1b72d8111a2994ddd5dc1a6fbdc2ea"
    

    3、git branch

    git branch -v
    git branch -a 显示所有分支
    git branch -r 显示远程分支
    git checkout -b xxx origin/xxx 切换到xxx分支
    git checkout master 切换到master分支
    

    4、git log

    git log --pretty=oneline
    git log --online
    git reflog 可以使用{HEAD~n}操作
    

    5、git merge

    6、

    git commit   --amend        撤销上一次提交  并讲暂存区文件重新提交
    git checkout -- <file>     拉取暂存区文件 并将其替换成工作区文件
    git reset HEAD  -- <file>  拉取最近一次提交到版本库的文件到暂存区  改操作不影响工作区
    
  • 相关阅读:
    js 获取url参数
    new Date()日期在IOS的兼容问题
    js判断是否为微信浏览器
    ionic3 带数据返回上一页
    ionic3 打包android apk
    https打开有地图页面问题
    限制字符个数
    placeholder兼容ie
    Sequence Classification
    Part of Speech Tagging
  • 原文地址:https://www.cnblogs.com/xidianzxm/p/10761736.html
Copyright © 2011-2022 走看看