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

    git添加本地分支与远程分支对应关系:

    git branch --set-upstream master origin/master

    git pull远程分支:

    git checkout -b < new_branch > origin/< new_branch >

    git删除本地分支与远程分支:

     delete a local branch

    git branch -d the_local_branch

    remove a remote branch (if you know what you are doing!)

    git push origin :the_remote_branch



    git显示本地与远程所有分支对应关系:

    For all branches:

    git branch -avv

    For local branches only:

    git branch -lvv



    创建一个空的分支:
    git checkout --orphan <branchname>
    删除所有文件
    git rm -rf .
     
     
    git删除所有untrack文件:

    git clean -f
    But beware... there's no going back. Use -n or --dry-run to preview the damage you'll do.

    If you want to also remove directories, run git clean -f -d

    If you just want to remove ignored files, run git clean -f -X

    If you want to remove ignored as well as non-ignored files, run git clean -f -x

    git rename本地分支:

    git branch -m <oldname> <newname>



  • 相关阅读:
    学习笔记_2012_4_13垃圾回收原理与String类的学习
    第五篇
    HTML练习代码
    上课第一天base关键字
    第四篇
    firebug使用指南
    HTML5的新特性
    UML建模
    CSS学习总结
    (转载)About me [my way]
  • 原文地址:https://www.cnblogs.com/wangkangluo1/p/3579930.html
Copyright © 2011-2022 走看看