Git简易的命令行入门教程

Git 全局设置:

git config --global user.name "imsoft"
git config --global user.email "imsoft@qq.com"

创建 git 仓库:

mkdir imsoft.github.io
cd imsoft.github.io
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://git.oschina.net/imsoft/imsoft.github.io.git
git push -u origin master

已有项目?

cd existing_git_repo
git remote add origin https://git.oschina.net/imsoft/imsoft.github.io.git
git push -u origin master



一次完整本地代码推送远程仓库流程

①创建远程仓库(github/gitee/coding),复制项目地址,
  如:https://git.oschina.net/imsoft/imsoft.github.io.git
②本地进入项目存放目录,
  使用git clone https://git.oschina.net/imsoft/imsoft.github.io.git,做项目初始化
③将代码放入项目目录,使用git add . ,添加所有更新;
  使用git commit -m "备注的信息",添加备注;
  使用git push -u origin master 推送代码。

posted on 2016-05-19 00:27  imsoft  阅读(263)  评论(0编辑  收藏  举报

导航