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

  • 相关阅读:
    SoapUI 使用笔记
    git 使用笔记(二)
    git 使用笔记(一)
    jquery 拓展
    hdu 1024 Max Sum Plus Plus (DP)
    hdu 2602 Bone Collector (01背包)
    hdu 1688 Sightseeing (最短路径)
    hdu 3191 How Many Paths Are There (次短路径数)
    hdu 2722 Here We Go(relians) Again (最短路径)
    hdu 1596 find the safest road (最短路径)
  • 原文地址:https://www.cnblogs.com/mrsandstorm/p/5709263.html
Copyright © 2011-2022 走看看