关于git

向远程仓库提交:
#git remote add origin https://code.csdn.net/xsdou/ffmpeg.git
#git push -u origin master
断开远程仓库连接ffmpeg
#git remote rm origin

当向远程仓库更新文件时需要:
#git fetch origin
#git merge origin/master
#git push -u origin master
否则会报错:
error: failed to push some refs to 'https://github.com/budaxxx/InAppSetingsKitDemo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

查看当前在哪一个远程仓库:
#git remote -v
git 的一些配置:
#git config color.ui true //彩色的git输出
#git config format.pretty oneline //只显示一行注释信息
@在查看log的时候也可以这样用:
#git log --pretty=oneline
显示如下:
e52acf455649ce6e79e9eac94d233ad5095a1e33 second commit
814b74d1aa2c794481f155af333227b1cd501a52 Merge remote-tracking branch 'origin/ma
d41c8aec578a007e6082e08807475b723e61d94e my InAppSettingsKit demo
35ef6c623d33ce5c44c96f6769c53b88dd9576c3 delete InAppSettingsKit demo because co
7bad776da90d805b6053df022c1f485786f5e2d1 InAppSettingsKit commit Demo

posted on 2015-04-26 15:37  creeper  阅读(120)  评论(0编辑  收藏  举报

导航