zoukankan      html  css  js  c++  java
  • Git初始化项目 和 Gitignore

    初始化init:
    git init
    git status
    git add .
    git commit -am "init projrct"
    添加远程仓库:
    git remote add origin git@gitee.com:liuge36/mmall.git

    推送:
    git push -u -f oragin master

    查看远程分支:
    git branch -r

    采用分支开发 主干发布:
    git checkout -b V-1.0 origin/master

    当前分支:
    git branch

    把当前的分支推送给远程的分支:
    git push origin HEAD -u

    **=================================================**
    查看使用的传输协议:
    git remote -v
    重新设置成ssh的方式:(gitalb 码云 github应该都是类似的操作)

    git remote rm origin
    git remote add origin git@gitlab.qiziqi.xyz:liuge36/MyFirstTest.git
    git push -u origin master

    重新设置成http的方式:

    git remote rm origin
    git remote add origin http://gitlab.qiziqi.xyz/liuge36/MyFirstTest.git
    git push -u origin master
    这里接下来就是输入自己的gitlab的用户名和登录密码

    **================================================**
    Command line instructions

    Git global setup
    git config --global user.name "liuge36"
    git config --global user.email "893861319@qq.com"

    Create a new repository
    git clone git@gitlab.qiziqi.xyz:liuge36/MyFirstTest.git
    cd MyFirstTest
    touch README.md
    git add README.md
    git commit -m "add README"
    git push -u origin master

    Existing folder
    cd existing_folder
    git init
    git remote add origin git@gitlab.qiziqi.xyz:liuge36/MyFirstTest.git
    git add .
    git commit -m "Initial commit"
    git push -u -f origin master

    Existing Git repository
    cd existing_repo
    git remote rename origin old-origin
    git remote add origin git@gitlab.qiziqi.xyz:liuge36/MyFirstTest.git
    git push -u origin --all
    git push -u origin --tags

    **gitignore========**

    *.class
    
    #package file
    *.war
    *.ear
    
    #maven
    target/
    
    #eclipse ignore
    .settings/
    .project
    .classpatch
    
    
    #idea
    .idea/
    /idea/
    *.ipr
    *.iml
    *.iws
    
    #temp file
    *.log
    *.cache
    *.diff
    *.patch
    *.tmp
    
    # system ignore
    .DS_Strore
    Thnmbs.db
    
    
  • 相关阅读:
    下拉刷新ListView的实现原理
    自己总结的一些Java公用函数库
    异常处理的最佳实践[转载]
    Android Parcelable和Serializable的区别
    Android BroadcastReceiver介绍
    添加androidsupportv4 错误 java.lang.ClassNotFoundException: android.support.v4.view.ViewPager in loader dalvik.system.PathClassLoader
    [转载]SQL SERVER 数据类型详解
    pthread
    main参数
    实验二测试
  • 原文地址:https://www.cnblogs.com/liuge36/p/9882822.html
Copyright © 2011-2022 走看看