git个人常用命令

git
https://www.cnblogs.com/chenwolong/p/GIT.html

添加当前目录的所有文件到暂存区

$ git add .

提交暂存区到仓库区

$ git commit -m [message]

分支更新
git pull (从远程master 更新至 本地master)

列出所有本地分支

$ git branch

列出所有远程分支

$ git branch -r

切换到指定分支,并更新工作区

$ git checkout [branch-name]

合并分支内容
git merge origin/index-swper

再git push

新建项目流程

  1. 本地项目下 常见本地仓库
    • git init
    • git add*
    • git commit -m "pro init"
  2. GitHub上创建远程仓库
    • Create a new repository
      • 出现
      • echo "# 171208_gshop" >> README.md
        git init
        git add README.md
        git commit -m "first commit"
        git remote add origin https://github.com/izhaong/171208_gshop.git
        git push -u origin master
        `
  3. 连接本地仓库与远程仓库
    • 在本地项目中运行git remote add origin https://github.com/izhaong/171208_gshop.git
    • git push origin master
原文地址:https://www.cnblogs.com/izhaong/p/12154287.html