2019獨角獸企業重金招聘Python工程師標準>>>
git常用命令
?? ?git config --global user.name chenhongjiang
?? ?git config --global user.email 123@qq.com
?? ?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 https://gitee.com/xxx/gittest.git 把遠程地址取別名
?? ?git remote add origin https://gitee.com/xx/gittest.git 把遠程地址取別名
?? ?git push origin master 推送到遠程服務器上
?? ?git clone https://gitee.com/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@qq.com 本地生成ssh (一直回車)
?? ?
?? ?ssh -T git@github.com 通信
?? ?
?? ?git@github.com:chenhongjiang/test.git
?? ?https://github.com/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
?