julley 发表于 2018-6-28 09:26:46

windows下git的本地操作库、远程操作库流程!

  1、windows下git建立本地仓库
  $ git config --global user.name "hehe"
  $ git config --global user.email "hehe@163.com"
  2、创建密匙
  $ ssh-keygen -t rsa -b 4096 -C "hehe@163com"
  Generating public/private rsa key pair.
  Enter file in which to save the key (/c/Users/hehe/.ssh/id_rsa):
  Enter passphrase (empty for no passphrase):
  Enter same passphrase again:

  Your>  Your public key has been saved in /c/Users/heheiscool/.ssh/id_rsa.pub.
  The key fingerprint is:
  SHA256:gx8BsPtCRTwoKsD0D+tQeo+XIgl31mzKp6Qw2UrAIlQ heheiscool@163com
  The key's randomart image is:
  +-------+
  |o. E.+o          |
  |..+ .oo.         |
  |.o =. ...      |
  |= o += . .       |
  |*+.o=.= S      |
  |=+==o+.. o       |
  |++.+=+o .      |
  |.+.oo+         |
  |. . .            |
  +---------+
  3、查询创建的ssh秘匙
  $ls -al ~/.ssh
  total 28
  drwxr-xr-x 1 hehe 197609    0 12月 20 21:57 ./
  drwxr-xr-x 1 hehe 197609    0 12月 20 21:45 ../

  -rw-r--r-- 1 hehe 197609 3243 12月 20 21:57>
  -rw-r--r-- 1 hehe 197609743 12月 20 21:57>  -rw-r--r-- 1 hehe 197609803 12月 18 21:25 known_hosts
  4、初始化本地git仓库
  $ git init
  Initialized empty Git repository in C:/wamp64/www/other/www/.git/
  5、把文件添加到仓库
  $ git add .
  warning: LF will be replaced by CRLF in assets/css/colorpicker.css.
  The file will have its original line endings in your working directory.
  6、把文件提交到仓库
  $ git commit -m "first"
   first
  warning: LF will be replaced by CRLF in assets/css/colorpicker.css.
  The file will have its original line endings in your working directory.
  7、把本地库git到远程生成库
  hehe@hehe MINGW64 /c/wamp64/www/other/www (master)
  $ git remote add origin https://github.com/heheiscool/Keep.git
  fatal: remote origin already exists.
  8、把本地库文件push到远程建好库中
  $ git push -u origin master
  Counting objects: 123, done.
  Delta compression using up to 4 threads.
  Compressing objects: 100% (119/119), done.
  Writing objects: 100% (123/123), 1.63 MiB | 29.00 KiB/s, done.
  Total 123 (delta 27), reused 0 (delta 0)
  remote: Resolving deltas: 100% (27/27), done.
  To https://github.com/hehe/Keep.git

[*]      master -> master  Branch master set up to track remote branch master from origin.

ying0904peng 发表于 2019-1-11 10:38:14

了解一下
页: [1]
查看完整版本: windows下git的本地操作库、远程操作库流程!