git commit 用戶信息:
全局配置:
git config --global user.name "xxx" (自己的um賬號或者域賬號)
git config --global user.email "xxx" (郵箱)
查看配置是否正常
git config --global -l (比如我的um賬號為 makun771, 郵箱 為
makun771@pingan.com.cn)
git代碼提交
查看狀態 git status
提交到本地緩存區 git add .
提交到本地倉庫 git commit -m "初始化提交"
查看遠程倉庫地址 git remote -v(查看有沒有遠程地址)
綁定遠程地址 git remote add origin xxxx.xxx.git
推送自己代碼到遠程倉庫 git push -u origin master
刪除遠程倉庫地址 git remote rm origin
git tag
查看本地tag git tag
查看遠程tag git ls-remote --tags origin
創建本地tag git tag -a 1.0.0 -m 'xxxx'
推送本地tag到遠程 git push origin 1.0.0
推送本地所有tag到遠程 git push origin --tags
刪除本地tag git tag -d 1.0.0
刪除遠程tag git push origin :refs/tags/1.0.0
分支與合并
查看當前git分支 git branch
切換分支 git checkout <branch>
新建并運行分支 git checkout -b <branch>
合并分支 git merge <branch>
查看提交歷史 git log
合并單次提交 git cherry-pick commitId
貯藏
貯藏 git stash
貯藏列表 git stash list
應用貯藏 git stash apply
應用特定的貯藏 git stash apply stash@{2}
應用貯藏然后立即從棧上扔掉它 git stash pop
linux查看執行過的所有命令
history
history 10 最近的10條命令
CocoaPods清理本地緩存
列出所有本地已經緩存的第三方庫 pod cache list
清理指定的三方庫的緩存 pod cache clean xxx
重新從遠端拉取代碼 pod install