git
的使用流程及远程仓库github
的使用
一. git
的使用
-
创建本地仓库(工作区)
git init [-q | --quiet] [--bare] [--template=<template-directory>] [--shared[=<permissions>]] [<directory>]
-
将文件添加至暂存区
git add [<options>] [--] <pathspec>...
-
提交文件
git commit [<options>] [--] <pathspec>...
二. github
的使用
- 新建远程仓库
- 生成
SSH Key
ssh-keygen -t rsa -C "xx@xx.com"
- 在
github
中Add SSH Key
,复制id_rsa.pub
中的内容
- 设置远程库
git remote set-url origin git@github.com:GIShkl/MLAlgorithm.git
- 把一个已有的本地仓库与之关联
git remote add origin git@github.com:GIShkl/MLAlgorithm.git
- 把本地库的所有内容推送到远程库上
git push -u origin master (首次)
git push origin master