标签:pop roo one 查看 默认 stash direct git push har
此文有转载有原创,如有侵权,联系管理员
这里只总结git 作为client的用法, 有机会再总结作为server端的搭建 (ubuntu)
1: 安装
sudo apt-get install git
git --version // check
2: clong
eg:
1: creat git storage
root@ubuntu64-casa:/home# mkdir test
root@ubuntu64-casa:/home# cd test
root@ubuntu64-casa:/home/test# ls -la
total 8
drwxr-xr-x 2 root root 4096 Sep 8 12:32 .
drwxr-xr-x 14 root root 4096 Sep 8 12:32 ..
root@ubuntu64-casa:/home/test# git init
Initialized empty Git repository in /home/test/.git/
root@ubuntu64-casa:/home/test# ls -la
total 12
drwxr-xr-x 3 root root 4096 Sep 8 12:33 .
drwxr-xr-x 14 root root 4096 Sep 8 12:32 ..
drwxr-xr-x 7 root root 4096 Sep 8 12:33 .git
root@ubuntu64-casa:/home/test# more .git/
branches/ config description HEAD hooks/ info/ objects/ refs/
root@ubuntu64-casa:/home/test# more .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
root@ubuntu64-casa:/home/test# tree
.
0 directories, 0 files
root@ubuntu64-casa:/home/test# tree -a
.
└── .git
├── branches
├── config
├── description
├── HEAD
├── hooks
│ ├── applypatch-msg.sample
│ ├── commit-msg.sample
│ ├── post-update.sample
│ ├── pre-applypatch.sample
│ ├── pre-commit.sample
│ ├── prepare-commit-msg.sample
│ ├── pre-push.sample
│ ├── pre-rebase.sample
│ └── update.sample
├── info
│ └── exclude
├── objects
│ ├── info
│ └── pack
└── refs
├── heads
└── tags
10 directories, 13 files
2: clone
root@ubuntu64-casa:/home/test# git clone --help
NAME git-clone - Clone a repository into a new directory
SYNOPSIS
git clone [--template=<template_directory>]
[-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
[-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]
[--dissociate] [--separate-git-dir <git dir>]
[--depth <depth>] [--[no-]single-branch]
[--recursive | --recurse-submodules] [--] <repository>
[<directory>]
EXAMPLES
· Clone from upstream:
$ git clone git://git.kernel.org/pub/scm/.../linux.git my-linux
$ cd my-linux
$ make
· Make a local clone that borrows from the current directory, without checking things out:
$ git clone -l -s -n . ../copy
$ cd ../copy
$ git show-branch
· Clone from upstream while borrowing from an existing local directory:
$ git clone --reference /git/linux.git \
git://git.kernel.org/pub/scm/.../linux.git \
my-linux
$ cd my-linux
· Create a bare repository to publish your changes to the public:
$ git clone --bare -l /home/proj/.git /pub/scm/proj.git
3: 基本用法:
4: 使用的一些技巧
标签:pop roo one 查看 默认 stash direct git push har
原文地址:http://www.cnblogs.com/dundun/p/7494033.html