1、安裝git和vscode
2仲智、配置git
git config --global user.name "xxx"
git config --global user.email "xxx@163.com"
3买乃、vscode選擇文件夾作為工作目錄
4、vscode中進(jìn)入命令面板搜索git坎藐,選擇git初始化命令
5为牍、在文件夾中選擇git bash here
SSH模式
git remote add orgin git@github.com:xxx/aaa.git
HTTP模式
git remote add orgin https://github.com/xxx/xxx.git
xxx是你的github用戶名, aaa.git 是你在github上的倉(cāng)庫(kù)名
ssh和http互換的時(shí)候
# 先看一下遠(yuǎn)端地址是否自己想要的
git remote -v
# 不是就移除
git remote remove origin
6岩馍、輸入
git pull orgin master
將遠(yuǎn)程倉(cāng)庫(kù)拉到本地
1碉咆、個(gè)人在github上面創(chuàng)建了倉(cāng)庫(kù),通過本地的git拉取遠(yuǎn)程倉(cāng)庫(kù)到本地報(bào)錯(cuò)信息如下:
http://www.mamicode.com/info-detail-2523100.html
git pull push出現(xiàn)There is no tracking information for the current branch錯(cuò)誤
解決在通過git客戶端 git pull的時(shí)候出現(xiàn)Threre is no tracking information for the current branch . Please specify which branch you want to merge with蛀恩。
就是需要指定本地projet分支疫铜,跟遠(yuǎn)程倉(cāng)庫(kù)項(xiàng)目分支之間的關(guān)系,比如双谆,我們需要本地master對(duì)應(yīng)遠(yuǎn)程的master
git branch --set-upstream-to=origin/master master
git push --set-upstream orgin master