开发中git 的使用,git的常用命令

来源:互联网 发布:花千骨器灵晋级数据 编辑:程序博客网 时间:2024/06/14 06:00

详细教程请参照:http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/

下载git 客户端 完成之后配置环境变量:
在系统变量path最后添加git的bin目录:C:\Program Files (x86)\Git\bin

注意与前一变量用分号隔开


直接上命令:

clone: 

git  clone -b 分支名  远程giturl

如:git clone -b master https://git.oschina.net/2320055/Test.git

add:

git add -a (add所有文件都) 也可以 git add name(文件名)

commit:

git commit -m 'fuckgit '(-m 后面为提交的信息说明,貌似不能有空格 )


第一次使用的时候可能会出现“please tell me who you are ”


此时cmd 中敲入

git config --global user.email "你的邮箱"

git config --global user.name "你的名字"

执行 git commit 

有时候上述还是不行
敲入

git config  user.email "你的邮箱"

git config  user.name "你的名字"

在git commit 记好了


push:

git push origin master :master ( 将本地的master 提交到袁程程仓库的master分支) 

branch:

git branch (查看分支情况)

git branch name (创建分支)

git checkout name (切换分支)

pull:

git pull 





0 0