码迷,mamicode.com
首页 > 其他好文 > 详细

git基础命令

时间:2015-12-25 18:53:45      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:

 

 git pull 更新
git status 查看文件状态
git add .添加所有
git commit -a -m "xxxx" 提交
git push 推送至服务器
git diff xxx 查看某文件区别
git branch 查看当前分支
git branch -d 删除某分支
git checkout xxx 切换到xxx版本
 
创建git项目
 git init
 git add .
 主分支不能用master。我一般用new
git branch new
git checkout new
git branch -d master

2. 在服务器上 .git/hooks/post-receive文件最后添加:
cd /xxxxx 项目路径
unset GIT_DIR
git reset --hard

3. 在服务器上 .git/config文件里添加:
[receive]
        denyCurrentBranch = ignore
git commit -am‘update‘
 
客户端:
第一次克隆:git clone root@服务器地址:服务器项目路径
克隆完成后执行git config --global push.default simple
 
 
 

git基础命令

标签:

原文地址:http://www.cnblogs.com/liqiworks/p/5076500.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!