<h3>第一次使用前配置</h3>
git config --global user.name "Your Name"
git config --global user.email you@example.com
1.全局的config配置可以直接vim ~/.gitconfig修改 局部的則要當(dāng)前路徑下的vim ~/.gitconfig修改纽哥。
2.可以通過git config --list 查看gitconfig當(dāng)前全部配置。
<h3>本地提交到遠(yuǎn)程github</h3>
http://www.cnblogs.com/mengdd/p/3447464.html
<h3>刪除遠(yuǎn)程倉庫的文件</h3>
1.本地刪除那個(gè)文件儒鹿,然后add+commit+push弧岳,最后git reset HEAD^
<h3>刪除遠(yuǎn)程倉庫的文件</h3>
1.選中要?jiǎng)h除的項(xiàng)目凳忙,右上角setting 拉到右下角,點(diǎn)擊刪除
<h3>刪除本地倉庫</h3>
1.刪除內(nèi)部的 .git文件 rm -rf .git
2.正常刪除即可
<h3>問題1</h3>
"Everything up-to-date"
問題解釋:沒有可以上線的東西
問題解決:未git commit -m "".......
<h3>問題2</h3>
"You asked to pull from the remote 'origin', but did not specify a branch. Because this is not the default configured remote for your current branch, you must specify a branch on the command line."
問題解釋:分支指定錯(cuò)誤 格式為(git pull origin(分支) master(身份))
問題解決:例如:
1.git remote add origin https://github.com/XXX(username)/YYYY(projectname).git
2.git branch --set-upstream-to=origin/master master
3.git pull --rebase
4.git push -u origin master
<h3>問題3</h3>
"the requested upstream branch 'origin/master' does not exist"
問題解釋:push之前 選中分支時(shí):git branch --set-upstream-to=origin/master master 出現(xiàn)的錯(cuò)誤提示
問題解決:具體不知道什么問題禽炬,先git pull 一下涧卵,然后按照提示輸入shell就可以解決
<h3>問題4</h3>
error: Your local changes to the following files would be overwritten by merge: protected/config/main.phpPlease, commit your changes or stash them before you can merge.
問題解釋:本地有和遠(yuǎn)程沖突的修改
問題解決:
1.如果想本地覆蓋遠(yuǎn)程
git stash
git pull
git stash pop
2.遠(yuǎn)程覆蓋本地
git reset --hard ---慎用阿,腹尖,柳恐,本地的會(huì)直接沒有了。热幔。乐设。。
git pull
<h3>常見問題</h3>
http://www.cnblogs.com/northhurricane/p/3227335.html