git创建与使用步骤

来源:互联网 发布:nginx lua redis 安装 编辑:程序博客网 时间:2024/05/15 11:46

系统设置:

$ git config --global user.name "Your Name"$ git config --global user.email your.email@example.com

进入创建的新的应用程序的根目录,初始化一个新仓库:

$ git init

添加文件

$ git add .

查看暂存区域有哪些文件

$ git status

告诉git需要保存add的文件

$ git commit -m"reason"

查看历史提交信息

$ git log

将程序推到github上:

$ git remote add origin git@github.com:<username>/first_app.git$ git push -u origin master

创建分支: $ git branch mybranch
切换分支: $ git checkout mybranch
创建并切换分支:

 $ git checkout -b mybranch

列出本地所有分支

$ git branch
0 0