您的位置:首页 > 运维架构 > Linux

Git常用操作命令、linux 系统分支下载命令说明

2014-04-03 09:41 766 查看
一、提交本地代码到远程仓库:

1,初始化远程仓库

2,git clone origin到本地

3,copy需要备份的代码文件到本地目录下

4,通过git add --all或者git add 文件路径或名字,添加要提交的文件

5,git commit -m "更新日志" 将项目commit本地仓库

6,git push 提交本地仓库代码到远程仓库

二、本地切换版本

1,cd 本地项目

2,git checkout 版本分支号(github\oschina\coding在commit历史中都有对应的版本分支号,例如:coding的 “36c366a46dc5175a5b6846deeb41954d3e43d6c1”)

三、移除目录

1,git rm -r --cached 目录名字

(移除文件:git rm --cached 文件名字)

四、创建分支

1,git branch 分支名(默认以当前版本为分支点) 或 通过后台操作创建分支

2,clone master项目到本地

3,git checkout 分支名 (切换当前clone版本到指定分支下)

Packages for common Linux, BSD and Solaris distributions can be installed from the system specific repositories

# Debian/Ubuntu
$ apt-get install mercurial

# Fedora
$ yum install mercurial

# Gentoo
$ emerge mercurial

# FreeBSD
$ cd /usr/ports/devel/mercurial
$ make install

# Solaris 11 Express
$ pkg install SUNWmercurial
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: