独角兽企业重金招聘Python工程师标准>>>
git常用命令
git config --global user.name chenhongjiang
git config --global user.email 123@
git init 建立厂库
git status 查看状态
git add . 添加当前目录
git add a.php 添加文件
git commit -m "init" 提交
git rm t.txt 删除这个文件
git commit -m "del t.txt"
git remote add lianshou /xxx/gittest.git 把远程地址取别名
git remote add origin /xx/gittest.git 把远程地址取别名
git push origin master 推送到远程服务器上
git clone /xx/ceshi.git 下载项目
git pull lianshou master 更新项目
git log 看日志
git log --pretty=oneline 一行看日志
git reset --hard 版本号 网上切换版本
git branch 查看分支
git branch wechat 创建分支
git checkout wechat 切换到wechat 分支
git merge ali 合并分支
git remote remove lianshou 删除远程地址的别名
ssh-keygen -t rsa -C 123@ 本地生成ssh (一直回车)
ssh -T git@ 通信
git@:chenhongjiang/test.git
/xx/test.git
git push origin cheng
//推向指定推向cheng 分支
git pull origin master
//查看远程分支
git branch -a
git clone -b
git clone -b dev_jk http://xxx/service/tmall-service.git
冲突解决方法
在本地修改冲突文件,提交到master 分支,推送到服务器
下面是测试代码
12
34
<<<<<<< HEAD
master [当前master分支合并之前的代码]
=======
test1 [当前test1分支最新提交]
>>>>>>> test1
应该把 <<<<<<< HEAD ======= 去掉改成test1
git更新.gitignore后如何提交
git rm -r --cached .//清空缓存
git add .//重新提交
git commit -m "update .gitignore"
git push