Git 使用筆記

  • 獲取並刪除遠端已經不存在的分支
    git fetch origin --prune

  • push時遭遇conflict,手動解決,輸入指令調出merge工具:
    git mergetool
    保存文件後進行commit
    git commit -m '註釋'

  • 查看遠程倉庫地址信息
    git remote -v

  • 合併master
    git checkout master
    git merge master

  • 目錄對比
    git difftool -d branch1 branch2

Git global setup:

git config --global user.name "#name#"
git config --global user.email "#emailaddress#"

Create Repository

mkdir project
cd project
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin [email protected]:group/project.git
git push -u origin master

Existing Git Repo?

cd existing_git_repo
git remote add origin git@xx.xx.xx.xx:group/project.git
git push -u origin master
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章