zoukankan      html  css  js  c++  java
  • GIt如何进行代码管理

    一:Git账号设置(仅第一次需设置):

           1.首先打开GIt  Bash  界面

           2. 输入指令邮箱号: git config --global user.email "邮箱"

           3.输入指令GIt用户名 : git config --global user.name 用户名

           4.输入指令ssh: ssh-keygen -t rsa -C 邮箱

          

    二:Git如何上传代码。

           1.先找到指定脚本目录。指令: cd  e:/GIt/ehr-authomation

           2.添加上传文件。 指令: git add -A

         3: 查看修改文件。  指令: git status

           4:提交修改的文件。 指令: “git commit -m ""message(描述)”

           5: 上传仓储文件到服务器。指令: git push

         

    6.查看 上传文件是否成功。指令:git pull –rebase。 检查本地代码是否与服务器一致。

    小结: git常用指令。

        1.    Add文件
    git add <file>    (one file)
    git add -A (all)
    git add . (new, modified, without deleted)
    git add -u (modified, deleted, without new)

    2.    Commit到暂存区
    git commit -m ""
    git commit –s (# -s option is mandatory, git will add "Signed-off-by: YOUR NAME <YOUR EMAIL ADDRESS>" at the end of message.)

    3.    从remote取最新的代码到本地
    git pull –rebase

    4.    存在冲突,解决完冲突
    git add xxx
    git rebase --continue (or git rebase --skip)

    5.    提交
    git push origin HEAD:refs/for/master
    git push

    创建分支

    1. 切换到基础分支,如主干
    git checkout master


    2. 创建并切换到新分支
    git checkout -b  feature_XX


    git branch可以看到已经在feature_XX分支上


    3.更新分支代码并提交
    git add *


    git commit -m "create branch feature_XX"


    git push origin  feature_XX

  • 相关阅读:
    nyoj-68-三点顺序-计算几何
    zoj--1089--Lotto---DFS VS 暴力求解
    zoj----1090---The Circumference of the Circle---数学几何
    nyoj-阶乘0
    nyoj-回文字符串--动态规划
    nyoj-最长公共子序列---动态规划
    hdu-1285确定比赛名次---拓扑排序
    等式数量---hash算法
    学生学籍管理系统
    2020.2.9 解决Zabbix agent is not available&windows下安装zabbix-agent 主机部署监控
  • 原文地址:https://www.cnblogs.com/Shanghai-vame/p/7683470.html
Copyright © 2011-2022 走看看