美文网首页
gitlab初始化项目的3种方式

gitlab初始化项目的3种方式

作者: 苍老师的眼泪 | 来源:发表于2022-07-30 00:53 被阅读0次

    Command line instructions
    You can also upload existing files from your computer using the instructions below.

    Git global setup
    git config --global user.name "Administrator"
    git config --global user.email "admin@example.com"

    Create a new repository
    创建一个新的仓库

    git clone git@120.48.46.122:learning/git-demo.git
    cd git-demo
    git switch -c main
    touch README.md
    git add README.md
    git commit -m "add README"
    git push -u origin main
    

    Push an existing folder
    推送一个已有的文件夹(把该文件夹的东西初始化仓库)

    cd existing_folder
    git init --initial-branch=main
    git remote add origin git@120.48.46.122:learning/git-demo.git
    git add .
    git commit -m "Initial commit"
    git push -u origin main
    

    Push an existing Git repository
    推送一个已有的git仓库

    cd existing_repo
    git remote rename origin old-origin
    git remote add origin git@120.48.46.122:learning/git-demo.git
    git push -u origin --all
    git push -u origin --tags
    

    相关文章

      网友评论

          本文标题:gitlab初始化项目的3种方式

          本文链接:https://www.haomeiwen.com/subject/uzzhwrtx.html