1.git commit 數(shù)據(jù)到本地
git commit 到本地后,可以使用git pull從服務(wù)器拉取別人的最新代碼,沒有文件可以使用git push提交代碼
git 主要的操作有g(shù)it add ., git commit -m "提交內(nèi)容說明",git pull, git push,還有就是需要知道一些基本的解決沖突的方式.
git config --global user.email 查看git 的郵箱地址
git config --global user.name 查看git 的用戶名
更改git 地址:
//先查看remote的名字
git branch -r
//假設(shè)你的remote是origin笙什,用git remote set_url 更換地址
//remote_git_address更換成你的新的倉庫地址
git remote set-url origin remote_git_address
例如:git remote set-url origin ssh://ShiyongTan@192.168.88.10:29418/xxx(項目名稱)
git stash //緩存起來
git diff -w +文件名 // 合并
git checkout file-name //撤銷更改的文件
如果對于合并用起來還是不習慣的話, 建議可以使用撤銷命令(記得先備份更改的內(nèi)容,好撤銷后的復(fù)制和粘貼):
如果你已經(jīng)使用 git add . 命名, 先使用git reset HEAD <file>...來撤銷 git add . 的內(nèi)容,
然后使用git checkout -- <file> 撤銷 git commit -m "" 的某個文件內(nèi)容, 這個撤銷只是針對file 文件的撤銷, 撤銷后使用 git status 查看git 是否還有沖突.