zoukankan      html  css  js  c++  java
  • 【git】提交代码到远程仓库

    看完不用,就是一个字:忘! 之前学了两天git结果今天要用的时候,啥也想不起来....

    场景:

    已有远程仓库: git@192.168.1.1:test/test.git   

    要提交代码到远程仓库的新分支

    1.本地文件夹初始化   在代码所在文件夹执行

    git init

    2.添加远程仓库

    2.1 将本地主机中~/.ssh/id_rsa.pub 中的内容拷贝到远程仓库的profile->SSH Keys中    即添加认证

    2.2 添加远程仓库

     git remote add origin git@192.168.1.1:test/test.git     

    2.3 本地新建分支并切换到新分支

     git checkout -b new_branch 

    2.4 提交修改到本地分支

    git commit -m "add files"

    2.5 提交本地分支到远程仓库

    git push origin new_branch

    其他中间折腾时用到的指令:

    git fetch 
    git merge  
    git branch 
    git branch -a  查看所有分支
    git branch -r 查看远程分支
    git log
    git commit -am
  • 相关阅读:
    SQL SEREVR IO
    INTEL
    windows performance
    The DiskSpd Storage Performance Tool
    machine Learning
    NOSQL
    X64 Deep Dive
    Debugging and performance,ETW
    Disk Performance
    WCF transport-and-message-security
  • 原文地址:https://www.cnblogs.com/dplearning/p/7080610.html
Copyright © 2011-2022 走看看