• git常用命令


    ​## 新建Git项目提到远端仓库
    1、进入项目目录执行  git init
    2、关联远程仓库   git remote add origin 仓库地址
    3、提交代码  git commit
    4、将本地仓库推送到远端仓库, 本地记录推送到远端的master分支上  git push -u origin master

    git忽略无用文件 加入提交黑名单 解决方法

    根目录下创建.gitignore文件

    ## ide
    **/.idea
    *.iml
    
    ## backend
    **/target
    **/logs
    
    ## front
    **/*.lock
    

    常用命令

    1:git branch branchName(在本地创建一个命名为branchName的分支)
    2:git branch 查看当前自己所在的分支
    3:git branch -a 查看服务器的所有分支以及自己当前所在的分支
    4:git commit -m "描述"  提交代码
    5:git push origin branchName(把命名为branchName的本地分支推送到服务器)
    6:git checkout --track origin/branchName (切换为远程服务器上的命名为branchName的远程分支)
    7:git push origin branchName(提交代码到远程服务器上命名为branchName的分支上)
    8:git pull origin branchName (从远程分支上拉取代码)
    9:git status(查看,该指令作用是 列出修改过的(绿色标识)、新创建的(红色标识)、已经暂存但未提交的文件(白色标识))
    10:git merge 你检出的本地分支 --allow-unrelated-histories (两个分支合并  将要合并的分支拉取到本地 切换到要合并的主分)

  • 相关阅读:
    python库安装
    Reversing Linked List(根据输入序列对其做部分或全部反转)
    简单的一元二项(使用的是指针形式,方便调试)
    最大子序列问题
    centos6安装mysql5.5.53
    android中常用的drawable
    android四大组件之ContentProvider
    android使用shape来绘制控件
    android布局理解
    android命令行管理avd以及sqlite3命令
  • 原文地址:https://www.cnblogs.com/pengcool/p/15516420.html
Copyright © 2020-2023  润新知