`
greenmoon
  • 浏览: 46758 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

git基础知识--linux环境

 
阅读更多

 

1、 create branch
  1.1 git br brname
  1.2 git br brname tagname
2. remote branch
  git co brname
  git push origin brname
3. download branch
   git fetch origin brname
   git co  -b brname origin/brname
4. push remote tag
  git push origin DownloadRel1.0.14
 
  • 安装
    • ubuntun:sudo  apt-get install git
    • fedora: sudo yum install git
  • gitconfig 配置
[user]
name = xxx
email = xxx@xxx.com
[color]
ui = auto
branch = auto
status = auto
[alias]
st = status
di = diff
ci = commit
co = checkout
br = branch

 

  • nexux配置
 <settings>
  <profiles>
    <profile>
      <id>nexus</id>
      <repositories>
        <repository>
          <id>local-repository</id>
          <name>local private repository</name>
          <url>http://192.168.2.222:8081/nexus/content/groups/public</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>local-plugin-repository</id>
          <name>local private plugin repository</name>
          <url>http://192.168.2.222:8081/nexus/content/groups/public</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
    <profile>
      <id>nexus-snapshots</id>
      <repositories>
        <repository>
          <id>nexus-snapshots</id>
          <name>local private snapshots</name>
          <url>http://192.168.2.222:8081/nexus/content/groups/public</url>
        </repository>
      </repositories>
    </profile>
    <profile>
      <id>nexus-releases</id>
      <repositories>
        <repository>
          <id>nexus-releases</id>
          <name>local private releases</name>
          <url>http://192.168.2.222:8081/nexus/content/groups/public</url>
        </repository>
      </repositories>
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>nexus</activeProfile>
    <activeProfile>nexus-snapshots</activeProfile>
    <activeProfile>nexus-releases</activeProfile>

  </activeProfiles>


  <servers>
    <server>
      <id>releases</id>
      <username>admin</username>
      <password>admin123</password>
    </server>
    <server>
      <id>snapshots</id>
      <username>admin</username>
      <password>admin123</password>
    </server>
  </servers>
</settings> 

 

 

  • 下载代码
git clone git@192.168.2.222:icyWebCommon

 

  • 服务器端安装配置
    • 安装同上
    • 需要配置一个git用户
groupadd git
useradd git git
passwd git

 

  •  
    •  配置ssh授权
 cd /home/git
  mkdir .ssh
  vim .ssh//authorized_keys,添加个需要授权用户的public key
  chmod 640 authorized_keys
  cd ..
  chmod 700 .ssh

 

  •  构建代码库
  • ssh git@192.168.2.222
      mkdir icyWebCommon
      cd icyWebCommon
      git init --bare
    •  常用命令

    1、 create branch
      1.1 git br brname
      1.2 git br brname tagname
    2. remote branch
      git co brname
      git push origin brname
    3. download branch
       git fetch origin brname
       git co  -b brname origin/brname
    4. push remote tag
      git push origin DownloadRel1.0.14
     
    分享到:
    评论

    相关推荐

      git基础知识整理.pdf

      Git基础知识整理 Git是目前世界上最先进的分布式版本控制系统(没有之一)。 Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件。 Git 与常用的版本控制工具 CVS, ...

      BashGit:D-Lab对基本Bash命令和GitGitHub的3小时介绍

      D-Lab快速介绍了Bash + Git,这是我们的编程基础知识和Git基础知识研讨会的提炼: 编程基础知识: : Git基础知识: : 技术要求 需要笔记本电脑 OSX 您的系统可能已经安装了git。 通过打开终端并键入git进行...

      202311-Linux操作系统面试题(2023最新版)思维导图.zip

      1. Java基础知识: - 语法 - 面向对象编程 - 集合框架 - 异常处理 - 多线程编程 2. 数据库: - 熟悉SQL语言 - 了解关系型数据库和非关系型数据库 - 数据库连接池 - 数据库事务 3. Spring框架: - ...

      Git基础入门学习教程

      Git是一款分布式版本控制系统,它的目标是解决像Linux内核这样超大规模项目的版本管理问题。Git的速度快、设计简单、对非线性开发模式有强力支持,并且具有完全分布式特性。 对于Git的教程资源,你可以在诸如W3...

      6前端面试一面 6:开发环境相关知识点与高频考题解析.md

      - Linux 基础命令 - 前端构建工具 - 调试方法 本小节会重点介绍 Git 的基本用法、代码部署和开发中常用的 Linux 命令,然后以 webpack 为例介绍下前端构建工具,最后介绍怎么抓包解决线上问题。这些都是日常开发和...

      图形项目

      我正在了解该项目的基础知识。 建筑 视窗 git clone --recursive https://github.com/EliasWatson/Graphics-Project.git cmake -S Graphics-Project -B Graphics-Project/build cmake --build Graphics-Project/...

      Linux命令搜索工具linux-command.zip

      linux-command Linux命令大全搜索工具,内容包含Linux命令手册、详解、学习、搜集。   Linux命令分类 这里存放Linux 命令大全并不全,你可以通过linux-command来搜索,它是把 command ...

      programmingres

      Subversion基础知识(Apache) SVN初学者-https : SVN教程(deveo) - SVN速成课程(适用于Git用户)-http : 水银 水星-https : 初学者Mercurial - 吉特 Git - https://git-scm.com/ Git参考-...

      git-bootcamp

      git-bootcamp 该文件可教213名学生Linux和Git基础知识。

      all-about-git:WIP Git Wiki,专注于向开发人员介绍协作和开源项目

      本次研讨会将快速涵盖 git 的基础知识,然后进一步探索在团队中工作和协作管理项目的感觉。 All About Git repo 专为本次研讨会而创建,并将继续作为一个开源项目供合作者用作练习,同时也希望构建一个任何人都...

      ARM Linux 开发基础技能实战演练-视频教程.rar

      创龙ARM Linux 开发基础技能实战演练》 版权声明:本视频所有权归广州创龙电子科技有限公司所有。 本系列视频教程由广州创龙工程师精心录制,主要介绍 Linux 应用开发基础技能,包括以下五方面的内容: 1、...

      notes:关于不同主题的注意事项

      Git基础知识: 完全删除被跟踪的文件夹或文件,使其不再被跟踪。 当我们有大于100 mb的大文件无法通过git上传时,我们会 git filter-branch --index-filter 'git rm --cached --ignore-unmatch bigfile_name' ...

      cypress-workshop-basics:使用 Cypress.io 测试运行器进行端到端测试的基础知识

      workshop-basic 使用测试运行器进行端到端测试的基础知识要求任何计算机:Mac、Windows、Linux检查节点版本 $ node -v# for example v14.17.1$ npm -v# for example 6.14.13为了获取代码并安装 NPM 依赖项git clone ...

      way-to-unicorn:掌握这些知识以帮助加入独角兽公司

      计算机基础 Linux 数据结构与算法 编程语言 Go Go 语言学习资料与社区索引 Go Developer Roadmap go_command_tutorial Go Example CN Go-advice project-layout golang-design-pattern go-patterns go-perfbook ...

      linux内核调试分析指南

      ***第一部分:基础知识*** 总纲:内核世界的陷阱 源码阅读的陷阱 代码调试的陷阱 原理理解的陷阱 建立调试环境 发行版的选择和安装 安装交叉编译工具 bin工具集的使用 qemu的使用 skyeye的使用 UML的使用 vmware的...

      计算机面试基础知识:算法、数据库、网络、操作系统、面向对象

      源自github仓库https://github.com/CyC2018/Interview-Notebook,整理和打印教程内容为PDF文件可直接离线阅读。主要内容包括:Java、Git、OOP面向对象、Linux和操作...非常适合面试前拿来刷一遍,牢固掌握基础知识。

      git-tutorial:面向SFU Comp Sci学生的git教程

      在本教程中,您将学习: 如何安装/配置git Git基础知识(差异,提交等) 命令行上的基本git命令如何在文本编辑器中编辑文件如何与Github合作如何在Visual Studio项目中使用Github 在C和Python中还将有两个协作练习...

      涵盖C++ Primer 5th、 effective C++ 、 STL api和demos C++ 基础知识与理论等

      涵盖C++ Primer 5th、 effective C++ 、 STL api和demos C++ 基础知识与理论、 智能指针、C++11、 Git教程 Linux命令 Unix操作系统(进程、线程、内存管理、信号)计算机网络、 数据结构(排序、查找)、数据库、、...

      Git基础与实践(二)

      Git 的学习是开发和运维以及DevOps 工程师必不可少的,只有真正的了解了 Git 的基本知识,才能够对 Gitlab 和 Gerrit 有个更深入的认识,否则你就会感觉非常迷茫,因为这些知识完全要依赖于 Git 的基础知识。...

      gitlab-training:GitLab和Git的开源培训

      培训参与者将深入了解Git基础知识,配置和“良好”承诺。 他们还将通过存储库和用户管理了解GitLab基础知识,并继续通过实际练习练习Git版本控制。 参与者从独立环境中迁移,与他人协作并获得有关不同Git工作流程...

    Global site tag (gtag.js) - Google Analytics