Loving Coding & Visual Design

git常见问题

http://www.git-scm.com/book/en/v2/Getting-Started-About-Version-Control

## windows下git clone fatal错误: could not read Password

git config --global core.askpass "C:Program Filesgitlibexe cgit-coregit-gui--askpass"

##服务器上初始化repo

mkdir /home/adam/repo #create directory for new repository
cd /home/adam/repo
git init
touch firstfile
git add .
git commit

cd /home/adam
git clone –bare ./repo repo.git
touch repo.git/git-daemon-export-ok

客户端:
git clone ssh://adam@localhost:2222/home/adam/repo.git

## git如何再次添加ignore的文件?

注:如果要忽略的文件已被git管理,需要先移除,命令如下:

e.g.:

git rm -r --cached WebRoot/WEB-INF/classes/**/*

-r:递归

git commit

查看远程URL
git remote -v

修改remote

git remote set-url origin URL

git remote set-branches [--add] ...
git remote set-url [--push] []
git remote set-url --add
git remote set-url --delete

/////////////brnach
git checkout -b newbranch
=
git brnach newbranch
git checkoutnewbranch

改名:git branch -M oldbranch newbranch
/////////////////
git push local branch to remote:
git checkout -b user
//make/commit some changes
git push origin user

//////////////////stage
git stage .



下一页


最 近 文 章

  1. 来自kiko.com的互联网创业经验 - Tue, 22 Aug 2006 05:17:16 +0000
  2. Google工具栏的安全浏览功能 - Thu, 17 Aug 2006 08:57:48 +0000
  3. mac 终端常见问题 - Mon, 30 Nov -0001 00:00:00 +0000
  4. Login SSH with Rsa Key - Mon, 30 Nov -0001 00:00:00 +0000
  5. 重新学习Linux - Mon, 30 Nov -0001 00:00:00 +0000
  6. Linux基本管道命令 - Mon, 30 Nov -0001 00:00:00 +0000
  7. Reading - Mon, 30 Nov -0001 00:00:00 +0000
  8. 关于数据统计 - Mon, 30 Nov -0001 00:00:00 +0000
  9. Redis使用小结 - Mon, 30 Nov -0001 00:00:00 +0000
  10. Selenium自动化测试 - Mon, 30 Nov -0001 00:00:00 +0000