Git操作说明
使用git之前
下载安装Cygwin Terminal
下载地址
/
安装过成中注意,选择git 和vim 相关选项进行安装完成后执行创建目录(和linux命令一样)
到创建好的目录下
执行
git clone /zople/365Project.git
检出项目
Git 相关命令以及操作流程
1.git config
说明:第一次操作时需要配置git的一些信息
例子:
git config -- global “Your Name”
git config -- global user.email “you@”
2 . git add
说明: 添加新增的内容需要add一下
例子:
git add /home/root/aaa/* (当前目录下所有的更新)
3.git commit
说明: commit如下所示–m返回提交时的信息;
git commit –m “message” -a
4.git pull
在执行push 之前使用pull 确保push之前是最新的
5.git push
push 时会遇到各种问题需要merge 需要编辑后处理冲突问题之后再执行commit再push
如果没有文件冲突问题就会很成功提交
6.git rm
删除不需要的文件;在删除之前执行下pull
然后commit 再执行push
7更多强大命令,在用的时候大家共同研究,更新
执行下git help
$ git help
usage: git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
[-c name=value] [--help]
<command> [<args>]
The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
fetch Download objects and refs from another repository
grep Print lines matching a pattern
init Create an empty git repository or reinitialize an existing one log Show commit logs
merge Join two or more development histories together
mv Move or rename a file, a directory, or a symlink
pull Fetch from and merge with another repository or a local branch push Update remote refs along with associated objects
rebase Forward-port local commits to the updated upstream head
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index
show Show various types of objects
status Show the working tree status
tag Create, list, delete or verify a tag object signed with GPG 分支的建立,合并,和删除用的时候再研究。