zoukankan      html  css  js  c++  java
  • Git常用操作

    一、Git 初次提交发布代码

    1、本地电脑安装git;

    2、gitlab、github创建仓库;

    3、git配置

    在进入git的命令行的时候可以先配置和查看git的用户。
    #git config --list
     
    如下图所示出现你的正确名字和邮箱说明配置正确。

    配置用户名和邮箱。

    #git config --global user.name "xxxxxxx"
    #git config --global user.email "xxxxxx@xxxxx.com"

    4、创建本地仓库

    ①新建一个文件夹,如git_demo
    ②打开bash,进入文件目录,输入#git init
    ③#ll -a 查看出现隐藏文件,说明创建成功

    5、创建仓库并提交代码

    # 初始化仓库
    $ git init    
    
    # 本地仓库与远程仓库建立链接
    $ git remote add origin git@gitlab.***.com:linlianhuao/**.git
    
    # 添加指定文件到暂存区  
    $ git add [file1][file2...]
    
    # 添加当前目录的所有文件到暂存区
    $ git add .
    
    # 提交暂存区到仓库区
    $ git commit -m [提示信息]
    
    # 提交到远程仓库
    $ git push origin master
    

      

    注意:以后push前,先将远程repository的修改pull(拉)下来

     # pull(拉)代码
     $ git pull
    

      

  • 相关阅读:
    进程与线程
    the art of seo(chapter seven)
    the art of seo(chapter six)
    the art of seo(chapter five)
    the art of seo(chapter four)
    the art of seo(chapter three)
    the art of seo(chapter two)
    the art of seo(chapter one)
    Sentinel Cluster流程分析
    Sentinel Core流程分析
  • 原文地址:https://www.cnblogs.com/lizhewei/p/11686726.html
Copyright © 2011-2022 走看看