Github浣跨敤璁板綍
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Github浣跨敤璁板綍相关的知识,希望对你有一定的参考价值。
鏍囩锛?a href='http://www.mamicode.com/so/1/email' title='email'>email
鍥剧墖 鏌ョ湅 鐢ㄦ埛 remote http strong 娌′簨 git mergeGithub浣跨敤璁板綍
閰嶇疆Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
鏀逛负鑷繁鐨刵ame鍜屽湴鍧€锛岀户缁洖杞︼紝榛樿璺緞鍜屽瘑鐮侊紝缁х画鍥炶溅锛岀敓鎴?ssh,鎵撳紑id_rsa.pub锛屽鍒秌ey鍒癵ithub鐨剆etting涓€?/p>
$ ssh -T git@github.com
楠岃瘉鏄惁杩炰笂github锛屾樉绀篩ou鈥榲e successfully authenticated, but GitHub does not provide shell access
$ git config --global user.name "your name" $ git config --global user.email "your_email@youremail.com"
棣栨浣跨敤闇€瑕侀厤缃敤鎴峰悕瀵嗙爜锛?/p>
$ git remote add origin git@github.com:yourName/yourRepo.git
閰嶇疆杩滅▼鍦板潃锛屽皢鏈湴浠撳簱涓庤繙绋嬪簱鍏宠仈銆傛敼涓鸿嚜宸辩殑name鍜屽湴鍧€锛寉ourRepo.git鏄垰鎵嶈繙绋嬪垱寤虹殑浠撳簱
鏌ョ湅宸叉湁鐨勮繙绋嬪簱
git remote git remote -v 锛堣缁嗕俊鎭級
1. 鍒涘缓涓€涓増鏈簱
$ mkdir Testgit $ cd Testgit $ pwd 鏄剧ず褰撳墠鐩綍
3.鎶婁竴涓枃浠跺悓姝ュ埌杩滅▼git浠撳簱
- 绗竴姝ワ紝娣诲姞鏂囦欢
$ git add readme.txt/*
- 绗簩姝ワ紝鎻愪氦鏀瑰姩鍒颁粨搴?/li>
git commit -m "浠g爜鎻愪氦淇℃伅"
鍒拌繖閲屾槸鏈湴鎻愪氦
- 绗笁姝ワ紝鎻愪氦鍒拌繙绋嬪簱
git push origin master
origin鏄厤缃椂鍐欑殑杩滅▼搴撳悕
鐜板湪杩滅▼github灏辫窡鏈湴鍚屾浜嗐€?/p>
4. 灏嗚繙绋嬪唴瀹规洿鏂板埌鏈湴
git pull
鎴?git pull origin master
5. 浠庤繙绋嬪厠闅嗛」鐩埌鏈湴
git clone ssh鍊?https鍦板潃
6. 浣跨敤鍒嗘敮
鍒涘缓骞跺垏鎹㈠垎鏀痙ev
git checkout -b dev
#git checkout dev琛ㄧず浠呭垏鎹㈠垎鏀?
#git branch 鏌ョ湅鍒嗘敮
鍦ㄨ鍒嗘敮涓嬩慨鏀硅椤圭洰鐨勪换鎰忔枃浠?/p>
灏嗗垎鏀笂鐨勪慨鏀规彁浜ゅ埌鏈湴,濡傛灉涓峱ush鍗冲鍏朵粬浜轰笉鍙
git add *
git commit -m "淇敼鏁版嵁搴撹繛鎺?
鍒囨崲鍥炰富鍒嗘敮master
git checkout master
灏哾ev鍒嗘敮淇敼鍐呭鎺ㄩ€佸埌杩滅▼搴?/p>
git push origin dev
鏈€鍚庡悎骞跺垎鏀笌master锛屽彲鑳藉瓨鍦ㄥ啿绐?/p>
git merge dev
鎺ㄩ€佸埌杩滅▼master
git push origin master
鎶ラ敊璁板綍
error: failed to push some refs to 鈥榞it@github.com:鈥?/p>
杩欐槸涓€涓枃浠跺啿绐佺殑閿欒
杩愯
git pull --rebase origin master
鏈夋姤閿欙細
error: Failed to merge in the changes.
hint: Use 鈥榞it am --show-current-patch鈥?to see the failed patch`
git add *
git rebase --continue
git pull --rebase testgitorigin master
git push testgitorigin master
姝ゆ椂灏卞皢鏈湴鍚屾鍒拌繙绋嬨€?/p>
- 鍏嬮殕椤圭洰鏃跺嚭閿?/li>
logon failed
瑙e喅锛氶」鐩槸private锛屽洜涓烘病鏈夋椤圭洰鐨勬潈闄?/p>
以上是关于Github浣跨敤璁板綍的主要内容,如果未能解决你的问题,请参考以下文章