• git安装
    由于git的大名气,现有linux基本都已支持源安装,直接yum或者zypper即可,非互联网环境code安装。
  • git全局配置配置文件在/etc/.git
  • git学习资料
    • http://www.yiibai.com/git/git_environment.html
    • http://lib.csdn.net/base/28

      Git基本常用命令如下:

      git init             #把当前的目录变成可以管理的git仓库,生成隐藏.git文件。
      git add XX           #把xx文件添加到暂存区去。
      git add .            #把当前目次下代码参加git的跟踪中,意思就是交给git经管,提交到本地库
      git commit –m “XX”   #提交文件 –m 后面的是注释。
      git status           #查看仓库状态
      git diff  XX         #查看XX文件修改了那些内容
      git log              #查看历史记录
      git reset  --hard HEAD^ 或者 
      git reset  --hard HEAD~ 回退到上一个版本
      #(如果想回退到100个版本,使用git reset –hard HEAD~100 )
      cat XX               #查看XX文件内容
      git reflog           #查看历史记录的版本号id
      git checkout -- XX   #把XX文件在工作区的修改全部撤销。
      git rm XX            #删除XX文件
      git remote add origin uri #关联一个远程库
      git push –u(第一次要用-u 以后不需要) origin master #把当前master分支推送到远程库
      git clone uri        #从远程库中克隆
      git fetch origin     #取得长途更新
      git pull             #从远程推送至本地
      git checkout –b dev  #创建dev分支 并切换到dev分支上
      git branch           #查看当前所有的分支
      git checkout master  #切换回master分支
      git merge dev        #在当前的分支上合并dev分支
      git branch –d dev    #删除dev分支
      git branch name      #创建分支
      git stash            #把当前的工作隐藏起来 等以后恢复现场后继续工作
      git stash list       #查看所有被隐藏的文件列表
      git stash apply      #恢复被隐藏的文件,但是内容不删除
      git stash drop       #删除文件
      git stash pop        #恢复文件的同时 也删除文件
      git remote           #查看远程库的信息
      git remote –v        #查看远程库的详细信息
      git push origin master  #Git会把master分支推送到远程库对应的远程分支上
      
      git add 常见错误
    • warning: LF will be replaced by CRLF in post.php.
      解决 git config –global core.autocrlf false

      git init 常见错误
    • error: src refspec master does not match any.
      引起该错误的原因是,目录中没有文件,空目录是不能提交上去的
    • error: insufficient permission for adding an object to repository database ./objects
      服务端没有可写目录的权限
    • fatal: remote origin already exists.
      解决办法:$ git remote rm origin
    • error: failed to push som refs to ……..
      解决办法:$ git pull origin master //先pull 下来 再push 上去

 

分类: Git

10 条评论

bet168wallet · 2025-12-19 20:15

Alright, so I hooked up my bet168wallet, and the transactions were smooth. Super easy topping up and withdrawing. Give it a spin if you’re keen: bet168wallet

777fegamedownload · 2025-12-24 10:57

777fegamedownload – the name sounds kinda lucky. I’m hoping they have some cool free games. Worth a quick look-see later. Visit 777fegamedownload!

peryaplus · 2026-01-14 16:43

peryaplus https://www.rsperyaplus.net

peso99 · 2026-01-14 17:11

peso99 https://www.repeso99.net

pin77 casino · 2026-01-15 02:55

pin77 casino https://www.pin77-ol.com

plot777 · 2026-02-10 04:01

[7378]Plot777: The premier Philippines online casino. Experience top-tier Plot777 slot online games. Fast Plot777 login, easy Plot777 register, and secure Plot777 app download via our official Plot777 casino link. Join Plot777, the premier Philippines online casino! Experience top-tier Plot777 slot online games today. Enjoy fast Plot777 login, easy Plot777 register, and secure Plot777 app download via our official Plot777 casino link for a premium gaming experience. visit: plot777

betgorilla · 2026-03-01 12:29

Betgorilla? Love the name! Hope the odds are as strong as a gorilla. Let’s spin those reels! betgorilla

hh88casinologin · 2026-03-01 12:29

Alright, hh88casinologin seems like a decent spot to get your game on. The login process was smooth, thankfully. No one likes a dodgy login. Give it a shot if you’re curious: hh88casinologin

vb777vb77 · 2026-03-01 12:30

Gotta say, vb777vb77 is… a name. But the site itself is alright. Nothing super groundbreaking, but a solid choice if you’re looking for something familiar. Give vb777vb77 a whirl: vb777vb77

peso789 · 2026-03-01 14:32

[3857]Peso789 Casino: Login, Register, Slots Game & App Download Join Peso789 Casino, the premier destination for online slots in the Philippines! Register now or login to play. Download the Peso789 app today for non-stop action and big wins. visit: peso789

回复 peryaplus 取消回复

Avatar placeholder

您的邮箱地址不会被公开。 必填项已用 * 标注