您的位置:首页 > 其它

git创建与使用步骤

2015-09-02 16:57 387 查看
系统设置:

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


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

[code]$ git init


添加文件

[code]$ git add .


查看暂存区域有哪些文件

[code]$ git status


告诉git需要保存add的文件

[code]$ git commit -m"reason"


查看历史提交信息

[code]$ git log


将程序推到github上:

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


创建分支:
$ git branch mybranch


切换分支:
$ git checkout mybranch


创建并切换分支:

[code] $ git checkout -b mybranch


列出本地所有分支

[code]$ git branch
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: