zoukankan      html  css  js  c++  java
  • git创建远程仓库以及在本地提交到远程仓库的方法

    Git create remote repository and usage in the local environment

    1. create the remote repository

    loggin the server

    $ cd ~/git/git_learn/
    $ mkdir project.git
    $ cd project.git
    $ git init --bare

    thus there are some files and directories in the directory '~/git/git_learn/project.git/', just like the following picture

     and then you need to add the write access to this repository, so that you can git push in the local environment

    $ cd ~/git/git_learn
    $ chmod -R 777 project.git ( significant )

    2. In your local environment, open 'bash' shell, and initialize a local repository(git project)

    $ cd ~/test
    $ mkdir Myproject.git
    $ cd Myproject.git $ git init

    and the next step is to add new file or modify existing file, then commit them

    $ vim main.c
    $ git add main.c / $ git add .
    $ git commit -s ( confirm the user.name and user.email are correct and available ) / $ git commit -m "create the project and add main.c"
    $ git remote add origin george@10.168.101.104:/home/george/git/git_learn/project.git ( here please confirm the remote repository has write access )
    $ git push origin master

    3. How to clone this project to local environment

    $ cd ~/test1
    $ git clone george@10.168.101.104:/home/george/git/git_learn/project.git
    --------------------------------------------- Study needs record, record needs review ---------------------------------------------
  • 相关阅读:
    软件测试 (三) 界面测试
    软件测试 (二) 六年软件测试感悟
    软件测试 (一) 软件测试方法大汇总
    第二阶段站立会议6
    第二阶段站立会议5
    构建之法阅读笔记04
    第二阶段站立会议4
    第二阶段站立会议3
    第二阶段站立会议2
    第二阶段站立会议1
  • 原文地址:https://www.cnblogs.com/georgemxx/p/11624667.html
Copyright © 2011-2022 走看看