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
    

      

  • 相关阅读:
    Redis持久化
    Java多线程面试题
    Spring学习总结(1)-注入方式
    SpringCloud常用注解
    Linux安装Redis
    Linux系统安装MySQL
    [转]Java CPU 100% 排查技巧
    ImportError: attempted relative import with no known parent package
    python出现Non-ASCII character 'xe6' in file statistics.py on line 19, but no encoding declared错误
    10个不为人知的 Python 冷知识
  • 原文地址:https://www.cnblogs.com/dqh123/p/12073053.html
Copyright © 2011-2022 走看看