git使用

来源:互联网 发布:会议抽奖软件 编辑:程序博客网 时间:2024/06/07 23:26

cd $gitdir
git init   创建一个git工作目录
创建相关内容后
git add .
git commit   提交   git commit -m "版本及备注信息"

在第一次使用git时,一般要设置配置信息
git config --global user.name "Your Name"
git config --global user.email your@your.com

查看版本历史:
git log
git log --stat --suummary
git show

撤销与恢复
git-reset --mixed | --soft | --hard

协同开发
git clone ieen@10.0.14.188:~/work work //SSH
git pull jieen@10.0.3.38:~/newwork

合并冲突解决:
git clone jieen@10.0.3.38:~/work work
项目开发
git add 改动的文件
git commit
git pull
解决版本合并问题
git push

项目分支
git branch local
git checkout local
分支合并
git checkout master  切换分支为master
git merge local    将local分支与当前分支合并
git branch -d local  只能删除参与合并的分支

原创粉丝点击