[sourcecode language="bash"] $ cd ~ # create a dir for your repositories $ mkdir git-repos # create a dir for your project e.g. depot $ mkdir depot.git $ init the dir $ git --bare init $ cd .. # create a tmp folder for testing $ mkdir tmp $ cd tmp # clone to tmp folder $ git clone file:///home/yourname/git-repos/depot.git # done! [/sourcecode] [sourcecode language="bash" wraplines="true"] # If you want to clone it to you computer, $ git clone ssh://pxiao@xiaopeng.me/home/yourname/git-repos/depot.git # If you already have this folder, you may want to checkin your local code into that repository: $ git clone ssh://pxiao@xiaopeng.me/home/yourname/git-repos/depot.git depot-temp $ mv depot-temp/.git depot/ $ cd depot $ git status $ git config user.name "pxiao" $ git config user.email "eagle.xiao@gmail.com" # ignore something $ vi .gitignore # input: .idea \n .idea/**/* $ git add .gitignore $ git commit .gitignore -m "commit .gitignore" # commit other files $ git add . $ git commit -a -m "initial rev" # here -a means 'all' not 'add' $ git push origin master [/sourcecode]

相关文章: