git shell 命令


git shell常用命令大全

git branch 查看本地所有分支

git status 查看當前狀態 
git commit 提交 
git branch -a 查看所有的分支
git branch -r 查看遠程所有分支
git commit -am "init" 提交併且加註釋 
git remote add origin [email protected]:ndshow
git push origin master 將文件給推到服務器上 
git remote show origin 顯示遠程庫origin裏的資源 
git push origin master:develop
git push origin master:hb-dev 將本地庫與服務器上的庫進行關聯 
git checkout --track origin/dev 切換到遠程dev分支
git branch -D master develop 刪除本地庫develop
git checkout -b dev 建立一個新的本地分支dev
git merge origin/dev 將分支dev與當前分支進行合併
git checkout dev 切換到本地dev分支
git remote show 查看遠程庫
git add .
git rm 文件名(包括路徑) 從git中刪除指定文件
git clone git://github.com/schacon/grit.git 從服務器上將代碼給拉下來
git config --list 看所有用戶
git ls-files 看已經被提交的
git rm [file name] 刪除一個文件
git commit -a 提交當前repos的所有的改變
git add [file name] 添加一個文件到git index
git commit -v 當你用-v參數的時候可以看commit的差異
git commit -m "This is the message describing the commit" 添加commit信息
git commit -a -a是代表add,把所有的change加到git index裏然後再commit
git commit -a -v 一般提交命令
git log 看你commit的日誌
git diff 查看尚未暫存的更新
git rm a.a 移除文件(從暫存區和工作區中刪除)
git rm --cached a.a 移除文件(只從暫存區中刪除)
git commit -m "remove" 移除文件(從Git中刪除)
git rm -f a.a 強行移除修改後文件(從暫存區和工作區中刪除)
git diff --cached 或 $ git diff --staged 查看尚未提交的更新
git stash push 將文件給push到一個臨時空間中
git stash pop 將文件從臨時空間pop下來
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章