[CVS] git 使用

来源:互联网 发布:电信的网络架构新变化 编辑:程序博客网 时间:2024/05/10 22:22

下载 : http://pan.baidu.com/s/1kT5nRuf 密码: f7b2
常见的公共平台:
1. https://github.com/
2. https://gitlab.com
3. https://code.csdn.net/dashboard/index

常见配置(http://git-scm.com/book/en/v2/GitHub-Account-Setup-and-Configuration)

$ git config --global core.quotepath false$ git config --global i18n.logOutputEncoding utf-8$ git config --global i18n.commitEncoding utf-8$ git config --global user.name 'xxx'$ git config --global user.email 'xxx@gmail.com'$ git config --global color.ui true$ git config --global alias.ci commit$ git config --global alias.st status$ git config --global alias.co checkout$ git config --global alias.br branch

  • 仓库 (CRUD)
# 第一种是在现存的目录下,通过导入所有文件来创建新的 Git 仓库。$ git init$ git add *.c$ git add README$ git commit -m 'initial project version'
# 第二种是从已有的 Git 仓库克隆出一个新的镜像仓库来(常用).$ git clone https://github.com/liqiang199105/Spoon-Knife.git$ git clone https://github.com/liqiang199105/Spoon-Knife.git [your_name]
# 远程库(http://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes)$ git remote //查看仓库别名$ git remote -v //查看所有fetch & push仓库$ git remote show [remote-name] //查看远程仓库信息$ git remote add github https://github.com/liqiang199105/Spoon-Knife.git //添加远程仓库$ git remote rename github mygithub //远程仓库的重命名$ git remote rm mygithub //远程仓库的删除$ git fetch [remote-name] //从远程仓库抓取数据$ git push [remote-name] [branch-name] //推送数据到远程仓库
  • 分支 (CRUD)
  • 未完待续...

0 0
原创粉丝点击