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链接

  • 相关阅读:
    [NOI2005]维护数列——Splay
    [Poi2000]病毒——补全AC自动机
    POJ1509 Glass Beads——SAM(后缀自动机)
    「NOI2011」阿狸的打字机——AC自动机+树状数组
    7.12Test——Graph Theory 1
    [BJWC2010]严格次小生成树
    7.09Test——DS1
    [SCOI2015]小凸想跑步——半平面交
    词频统计器(第三版)
    四则运算(测试)
  • 原文地址:https://www.cnblogs.com/mrsandstorm/p/5709263.html
Copyright © 2011-2022 走看看