【フルスタックの道】バージョン管理コース1_Gitは、ローカルコードをリモートウェアハウスにプッシュする方法(20190709 v 1.0)


全スタックの道のバージョン管理基礎課程へようこそ
ブログアドレス:https://segmentfault.com/a/1190000019707348このシリーズの文章は主にコードのバージョン制御について説明し、多くの同業者にいくつかの助けをもたらすことを望んでいます.問題があれば、すぐに伝言を残したり、QQ:243042162を追加したりしてください.
あなたが希望しなければ、何かがあなたの希望を超えていることに気づくことはありません.
背景
プロジェクト構築の初期は、まず基礎フレームワークを構築し、コードをコード管理サーバに配置し、プロジェクト構成員に検出させ、需要の開発を行う.実際のプロジェクトでgitリモートウェアハウスにコードをコミットする方法について重点的に説明します.
ステップ
  • 1.ダウンロードインストールgit自身のシステムはwin 10で、ダウンロードアドレス:https://git-for-windows.github.io/
  • 2.初期化バージョンライブラリ:git init
  • rain@DESKTOP-R3H1KFK MINGW64 /c/WebstormProjects/cmpy-project/project-center
    $ git init
    Initialized empty Git repository in C:/WebstormProjects/cmpy-project/p                                                                                      roject-center/.git/
    
    
  • 3.バージョンライブラリにファイルを追加:git add.
  • rain@DESKTOP-R3H1KFK MINGW64 /c/WebstormProjects/cmpy-project/project-                                                                                                      center (master)
    $ git add .
    warning: LF will be replaced by CRLF in assets/css/font-awesome.min.css.
    The file will have its original line endings in your working directory.
    warning: LF will be replaced by CRLF in assets/js/ie/html5shiv.js.
    The file will have its original line endings in your working directory.
    warning: LF will be replaced by CRLF in assets/js/ie/respond.min.js.
    The file will have its original line endings in your working directory.
    warning: LF will be replaced by CRLF in assets/js/jquery.min.js.
    The file will have its original line endings in your working directory.
    warning: LF will be replaced by CRLF in assets/js/skel.min.js.
    The file will have its original line endings in your working directory.
    
    
  • 4.バージョンライブラリにコミットし、コミットコメントを記入します:git commit-m「v 1.0」
  • rain@DESKTOP-R3H1KFK MINGW64 /c/WebstormProjects/cmpy-project/project-center (master)
    $ git commit -m "v1.0"
    [master (root-commit) 260e147] v1.0
     53 files changed, 8306 insertions(+)
    
    
  • 5.ローカルライブラリをリモートライブラリに関連付ける:git remote add originあなたのリモートライブラリアドレス
  • rain@DESKTOP-R3H1KFK MINGW64 /c/WebstormProjects/cmpy-project/project-center (master)
    $ git remote add origin      
    
  • 6.リモートにプッシュ:git push-u origin master-f
  • rain@DESKTOP-R3H1KFK MINGW64 /c/WebstormProjects/cmpy-project/project-center (master)
    $ git push -u origin master -f
    Counting objects: 65, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (65/65), done.
    Writing objects: 100% (65/65), 478.97 KiB | 0 bytes/s, done.
    Total 65 (delta 2), reused 0 (delta 0)
    
  • 7.ステータスの表示:git status
  • rain@DESKTOP-R3H1KFK MINGW64 /c/WebstormProjects/cmpy-project/project-center (master)
    $ git status
    On branch master
    Your branch is up-to-date with 'origin/master'.
    nothing to commit, working tree clean