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

    一:将本地的代码push到一个干净的服务器仓库中
    	git init
    	git add *
    	git commit -m "initialized"
    
    	把仓库推送到服务器
    	 git push origin master 
    	 
    	 git push http://192.168.0.172:9080/gp_iot/project_iot.git
    	 
    	 
    	fatal: The current branch master has no upstream branch.
    	To push the current branch and set the remote as upstream, use
    
    	git push --set-upstream http://192.168.0.172:9080/gp_iot/project_iot.git master
    		
    二: clone master分支代码:(下面的两条命令都正确)
    	git clone http://192.168.0.172:9080/gp_iot/project_iot.git 
    	git clone http://192.168.0.172:9080/gp_iot/project_iot.git master
    
    
    三: clone develp分支代码:
    
    	错误用法:(clone下来的还是master,不是develp)
    	git clone http://192.168.0.172:9080/gp_iot/project_iot.git develop  
    
    	正确:
    	先: git clone http://192.168.0.172:9080/gp_iot/project_iot.git 
    	再到clone下来后的目录内执行命令:
    	git checkout -b develop origin/develop
    	再看代码就是分支的代码了。
    	
    	
    	
    	
    git init
    git add *
    git commit -m "initialized"
    
    
    git push --set-upstream 仓库地址 master
    
    git branch develop
    
    git branch
    
    git checkout develop
    
    git push  仓库地址 develop:develop
    
    
    
    
    ------------------------------
    git push --set-upstream http://192.168.0.118:9080/gitlab/cmup-bd/cmup-doc-bd.git master
    
    
    git branch develop
    
    git branch
    
    git checkout develop
    
    git push  http://192.168.0.118:9080/gitlab/cmup-bd/cmup-doc-bd.git develop:develop
    
    
    ------------------------------
    git push --set-upstream http://192.168.0.118:9080/gitlab/cmup/cloud-config.git master
    git branch develop
    
    git branch
    
    git checkout develop
    
    git push  http://192.168.0.118:9080/gitlab/cmup/cloud-config.git develop:develop
    
    
    
    ------------------------------------------------
    git init
    git add *
    git commit -m "initialized"
    
    git push --set-upstream http://192.168.0.118:9080/gitlab/cmup-bd/cmup-clearing-spark.git master
    git branch develop
    
    git branch
    
    git checkout develop
    
    git push http://192.168.0.118:9080/gitlab/cmup-bd/cmup-clearing-spark.git develop:develop
    

      

  • 相关阅读:
    [Effective C++ --009]确定对象被使用前已先被初始化
    [Effective C++ --008]别让异常逃离析构函数
    [Effective C++ --007]为多态基类声明virtual析构函数
    [Effective C++ --006]若不能使用编译器自动生成的函数,就该明确拒绝
    [Effective C++ --005]了解C++默默编写并调用哪些函数
    [000]socket通信--server和client实现的简单例子
    [014]模板-模板实参推导
    [013]模板-非类型模板参数
    [012]泛型--lambda表达式捕获
    U3d keyCode值对应的按键
  • 原文地址:https://www.cnblogs.com/dqh123/p/12073053.html
Copyright © 2011-2022 走看看