zoukankan      html  css  js  c++  java
  • git使用的总结

    常用的几个命令

    1.查看git的所有分支 :git branch

    2.新加develop分支 :git branch develop

    3.切换到develop分支 :git checkout develop

    4.commit TEST.C文件 :git commit TEST.C -m "TEST.C add function func"    //-m是message的意思,后面的引号里面是对操作进行注释备注的意思

    5.上传当前分支上所有的文件 : git commit      //没有实验,这个是猜测

    6.新加feature-study分支 :git branch feature-study

    7.切换到feature-study分支 : git checkout feature-study

    8.上传当前分支上所有的文件 :git commit TEST.C -m "Feature add func study"

    9.切换到develop分支 :git checkout develop

    10.将feature-study分支合并到当前分支上 :git merge feature-study --no-off -m "merge feature_study into develop"

    11.查看当前所在分支 :git status

    12.删除feature-study分支 :git branch feature-study -d

    13.删除网络上的test分支 :git push origin --delete test        //To https://git.oschina.net/sandstorm/STM32F0_IR_BUZZER.git    [- [deleted] test]

    14.本地新建了一个分支rtt_buffer_dev之后,如果直接push是不可以的,需要把这个分支push到远程地址才行,使用的是  git push --set-upstream origin rtt_buffer_dev

    15.如何放弃所有本地修改?

       git checkout .        //本地所有修改的。没有提交的,都返回到原来的状态

       git stash               //把所有没有提交的修改暂存到stash里面。可用git stash pop回复

       git reset --hard HASH        //返回到某个节点,不保留修改。

       git reset --soft HASH         //返回到某个节点。保留修改

    补充:

    1.将一个新项目从github(或者码农)克隆到本地电脑 :git clone https://git.oschina.net/sandstorm/ZIGBEE_DEV_PASSTHROUGH.git   //后面的链接是项目的HTTPS链接

  • 相关阅读:
    转载 如何去掉超链接文字下的下划线
    Fedora 15安装 VirtualBox 4.1
    庆祝开通!
    Delphi直接读写XML修改版
    Perforce的资料一点也没查到
    AxWebBrowser的Navigate2方法写参数的偷懒方法
    腾讯2012实习生面试
    如何让div在IE6下自适应
    PhpStorm修改字体
    监听url
  • 原文地址:https://www.cnblogs.com/mrsandstorm/p/5709263.html
Copyright © 2011-2022 走看看