- 浏览: 583092 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (174)
- JBPM (3)
- WWF (0)
- JavaScript (11)
- J2EE (40)
- OperationSystem (11)
- 数据库 (12)
- CSS (1)
- Ajax (2)
- J2SE (30)
- Tools (10)
- 服务器中间件 (3)
- 异常 (0)
- Flex (5)
- jQuery (11)
- html (9)
- Ejb (1)
- HTML5 Shiv–让该死的IE系列支持HTML5吧 (1)
- Spring (9)
- Quartz (3)
- log4j (1)
- maven (1)
- cpdetector (1)
- JSON (1)
- log4jdbc (1)
- asm (8)
- FusionCharts (1)
- jqplot (1)
- highcharts (1)
- excanvas (1)
- html5 (1)
- jpcap介绍 (1)
- weblogic (3)
- URLURLClassLoader (0)
- URLClassLoader (1)
- ant (2)
- ivy (2)
- nexus (1)
- IT (0)
- LoadRunner (1)
- SCSS (1)
- ruby (1)
- webstorm (1)
- typescript (1)
- Jboss7 (1)
- wildfly (1)
- oracle (5)
- esb (0)
- dubbo (2)
- zookeeper (3)
- eclipse (1)
- Android (2)
- Studio (1)
- Google (1)
- 微信 (1)
- 企业号 (1)
- Linux (13)
- Oracle12c (1)
- Hadoop (1)
- InletexEMC (1)
- Windows (1)
- Netty (3)
- Marshalling (2)
- Protobuf (1)
- gcc (1)
- Git (1)
- GitLab (1)
- shell (2)
- java (3)
- Spring4 (1)
- hibernate4 (1)
- postgresql (1)
- ApacheServer (2)
- Tomcat (2)
- ApacheHttpServer (2)
- realvnc (1)
- redhat (7)
- vncviewer (1)
- LVS (4)
- LVS-DR (1)
- RedHat6.5 (5)
- LVS-NAT (1)
- LVS-IPTUNNEL (2)
- LVS-TUN (1)
- keepalived (2)
- yum (1)
- iso (1)
- VMware (1)
- redhat5 (1)
- ha (1)
- nginx (2)
- proguard (1)
- Mat (1)
- DTFJ (1)
- axis2 (1)
- web service (1)
- centos (1)
- random (1)
- urandom (1)
- apache (1)
- IBM (1)
- cve (1)
- 漏洞 (1)
- JDBC (1)
- DataSource (1)
- jdk (1)
- tuxedo (2)
- wtc (1)
最新评论
-
skying007:
好资料,谢谢分享给啊
FusionCharts在服务器端导出图片(J2EE版) -
cgnnzg:
大神好 可以发一份源码给我学习么 多谢了 978241085 ...
springmvc+dubbo+zookeeper -
jifengjianhao:
求源码:854606899@qq.com
springmvc+dubbo+zookeeper -
wdloyeu:
shihuan8@163.com邮箱网盘在哪,没找到。能给份源 ...
Java Socket长连接示例代码 -
huangshangyuanji:
求代码:45613032@qq.com
springmvc+dubbo+zookeeper
[root@testgit rpmlib]# pwd
/opt/rpmlib
[root@testgit rpmlib]# ls
asciidoc-8.6.9-1.el6.rfx.noarch.rpm gettext-devel-0.17-16.el6.x86_64.rpm
autoconf-2.63-5.1.el6.noarch.rpm libiconv-1.14.tar.gz
curl-devel-7.13.1-3.x86_64.rpm openssl-devel-1.0.1e-42.el6.x86_64.rpm
docbook2X-0.8.8-2.1.x86_64.rpm xmlto-0.0.18-4.x86_64.rpm
expat-devel-2.0.1-9.1.el6.x86_64.rpm zlib-devel-1.2.3-29.el6.x86_64.rpm
[root@testgit rpmlib]# rpm -q curl-devel
[root@testgit rpmlib]# rpm -ivh curl-devel-7.13.1-3.x86_64.rpm --nodeps
[root@testgit rpmlib]# rpm -q expat-devel
[root@testgit rpmlib]# rpm -ivh expat-devel-2.0.1-9.1.el6.x86_64.rpm --nodeps
[root@testgit rpmlib]# rpm -q gettext-devel
[root@testgit rpmlib]# rpm -ivh gettext-devel-0.17-16.el6.x86_64.rpm --nodeps
[root@testgit rpmlib]# rpm -q openssl-devel
[root@testgit rpmlib]# rpm -ivh openssl-devel-1.0.1e-42.el6.x86_64.rpm --nodeps
[root@testgit rpmlib]# rpm -q zlib-devel
[root@testgit rpmlib]# rpm -ivh zlib-devel-1.2.3-29.el6.x86_64.rpm --nodeps
[root@testgit rpmlib]# rpm -q perl-devel
perl-devel-5.10.1-119.el6_1.1.x86_64
[root@testgit rpmlib]# rpm -q asciidoc
[root@testgit rpmlib]# rpm -ivh asciidoc-8.6.9-1.el6.rfx.noarch.rpm --nodeps
[root@testgit rpmlib]# rpm -q autoconf
[root@testgit rpmlib]# rpm -ivh autoconf-2.63-5.1.el6.noarch.rpm --nodeps
[root@testgit rpmlib]# rpm -q docbook2X
[root@testgit rpmlib]# rpm -ivh docbook2X-0.8.8-2.1.x86_64.rpm --nodeps
[root@testgit rpmlib]# rpm -q xmlto
[root@testgit rpmlib]# rpm -ivh xmlto-0.0.18-4.x86_64.rpm --nodeps
要是没有gcc的相关编译器不能进行源码安装,下面是CentOS6上需要安装的gcc等相关rpm包:
cloog-ppl-0.15.7-1.2.el6.x86_64.rpm
cpp-4.4.6-4.el6.x86_64.rpm
gcc-4.4.7-16.el6.x86_64.rpm
gcc-c++-4.4.7-16.el6.x86_64.rpm
glibc-devel-2.12-1.166.el6.x86_64.rpm
glibc-headers-2.12-1.80.el6.x86_64.rpm
kernel-headers-2.6.32-279.el6.x86_64.rpm
libstdc++-devel-4.4.6-4.el6.x86_64.rpm
mpfr-2.4.1-6.el6.x86_64.rpm
ppl-0.10.2-11.el6.x86_64.rpm
[root@testgit opt]# tar -zxvf git-2.7.0.tar.gz
[root@testgit opt]# cd git-2.7.0
[root@testgit git-2.7.0]# autoconf
[root@testgit git-2.7.0]# ./configure --prefix=/usr/local
[root@testgit git-2.7.0]# make
[root@testgit git-2.7.0]# make install
[root@testgit git-2.7.0]# vi /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib --这一行是后加的,不加这一行在输入git --version的时候会报错
[root@testgit git-2.7.0]# /sbin/ldconfig
[root@testgit git-2.7.0]# git --version
git version 2.7.0
----------------------------------------------------------------------------------
下面是Git基本操作:
RPM包下载地址: http://rpm.pbone.net/index.php3/stat/21/year/2005/month/05/day/03
http://pkgs.org/download/
http://rpmfind.net/linux/rpm2html/search.php
如果你想从源码安装 Git,需要安装 Git 依赖的库:curl、zlib、openssl、expat,还有libiconv。 如果你的系统上有 yum (如 Fedora)或者 apt-get(如基于 Debian 的系统),可以使用以下命令之一来安装最小化的依赖包来编译和安装 Git 的二进制版:
$ sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel
$ sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev
为了能够添加更多格式的文档(如 doc, html, info),你需要安装以下的依赖包:
$ sudo yum install asciidoc xmlto docbook2x
$ sudo apt-get install asciidoc xmlto docbook2x
当你安装好所有的必要依赖,你可以继续从几个地方来取得最新发布版本的tar包。 你可以从Kernel.org网站获取,网址为https://www.kernel.org/pub/software/scm/git,或从 GitHub 网站上的镜像来获得,网址为 https://github.com/git/git/releases。 通常在 GitHub 上的是最新版本,但 kernel.org 上包含有文件下载签名,如果你想验证下载正确性的话会用到。
rpm -q gcc gcc-c++ glibc glibc-common glibc-devel
rpm -q libicu-devel patch gcc-c++ readline-devel zlib-devel libffi-devel openssl-devel make autoconf automake libtool bison libxml2-devel libxslt-devel libyaml-devel zlib-devel openssl-devel cpio expat-devel gettext-devel curl-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
rpm -ivh gettext-devel-0.17-16.el6.x86_64.rpm --nodeps
rpm -ivh libiconv-1.14-3.el6.x86_64.rpm --nodeps
tar -zxvf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local (或者#./configure --prefix=/usr/local/libiconv)
make
make install
接着,编译并安装:
$ tar -zxf git-2.7.0.tar.gz
$ cd git-2.7.0
$ make configure
$ ./configure --prefix=/usr
$ make all doc info
$ sudo make install install-doc install-html install-info
完成后,你可以使用 Git 来获取 Git 的升级:
$ git clone git://git.kernel.org/pub/scm/git/git.git
Red Hat Enterprise Linux 6.4源码安装Git服务器步骤如下:
rpm -q curl curl-devel zlib-devel openssl-devel perl cpio expat-devel gettext-devel
tar -zxf git-2.7.0.tar.gz
cd git-2.7.0
autoconf
./configure 或者 ./configure --prefix=/usr/local 或者 ./configure --prefix=/usr/local/git/
make
make install
[root@testagent lib]# pwd
/usr/local/lib
[root@testagent lib]# ls
charset.alias libcharset.so libiconv.la libiconv.so.2.5.1
libcharset.a libcharset.so.1 libiconv.so preloadable_libiconv.so
libcharset.la libcharset.so.1.0.0 libiconv.so.2
[root@testagent /]# vi /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib --这一行是后加的,不加这一行在输入git --version的时候会报错
[root@testagent /]# /sbin/ldconfig
[root@testagent git-2.7.0]# git --version
git version 2.7.0
[root@testagent git-2.7.0]# cd /usr/local/bin
[root@testagent bin]# pwd
/usr/local/bin
[root@testagent bin]# ls
git gitk git-shell git-upload-pack
git-cvsserver git-receive-pack git-upload-archive iconv
可以把Git服务加入到环境变量里:
[root@testagent /]# vi /etc/profile
export GIT_HOME=/usr/local/git/
export PATH=$PATH:$GIT_HOME/bin
创建Git仓库步骤如下:
[root@testagent git-2.7.0]# cd /
[root@testagent /]# useradd git
[root@testagent /]# passwd git
Changing password for user git.
New password:
BAD PASSWORD: it is WAY too short
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
[root@testagent /]# su - git
[git@testagent ~]$ ls
[git@testagent ~]$ mkdir mygitproject
[git@testagent ~]$ ls
mygitproject
[git@testagent ~]$ cd mygitproject/
[git@testagent mygitproject]$ ls
[git@testagent mygitproject]$ git --bare init
Initialized empty Git repository in /home/git/mygitproject/
[git@testagent mygitproject]$ ls
branches config description HEAD hooks info objects refs
[git@testagent mygitproject]$
https://git-for-windows.github.io/ 下载mysysgit
http://tortoisegit.org/download/ 下载TortoiseGit
先要clone一个.git文件夹到本地Windows机器
http://bbs.csdn.net/topics/390902529/
origin
git@192.168.3.56:mygitproject
http://blog.csdn.net/forever_wind/article/details/37506389
http://www.cnblogs.com/wang_yb/p/3867221.html
由于git默认拒绝了push操作,需要进行设置,修改.git/config添加如下代码:
[receive]
denyCurrentBranch = ignore
[git@testagent mygitproject]$ pwd
/home/git/mygitproject
branches config description HEAD hooks info objects refs
[git@testagent mygitproject]$ vi config
[core]
repositoryformatversion = 0
filemode = true
bare = true
[receive]
denyCurrentBranch = ignore
[git@testagent mygitproject]$ cat config
[git@testagent ~]$ pwd
/home/git
[git@testagent ~]$ git clone mygitproject git1
[git@testagent ~]$ git clone mygitproject git2
目前git branch是空的。我们提交一点东西建立master分支。
[git@testagent ~]$ cd git1
[git@testagent git1]$ pwd
/home/git/git1
[git@testagent git1]$ touch a.txt
[git@testagent git1]$ git add .
[git@testagent git1]$ git commit -m "init"
[git@testagent git1]$ git push origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 199 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To /home/git/mygitproject/
* [new branch] master -> master
[git@testagent git1]$ git branch -a
* master
remotes/origin/master
[git@testagent git2]$ pwd
/home/git/git2
[git@testagent git2]$ git pull origin
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /home/git/mygitproject
* [new branch] master -> origin/master
[git@testagent git2]$ ls
a.txt
[git@testagent heads]$ pwd
/home/git/mygitproject/refs/heads
[git@testagent heads]$ ls
master
[git@testagent git1]$ git commit -am "a.txt add : git1 user add nihao"
[master 4356801] a.txt add : git1 user add nihao
1 file changed, 2 insertions(+), 1 deletion(-)
本地分支提交到远程分支的命令格式: git push origin 本地分支:远程分支
[git@testagent git1]$ git push origin master:master
Counting objects: 3, done.
Writing objects: 100% (3/3), 277 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To /home/git/server
9e4111e..4356801 master -> master
Windows主机上修改了某个文件后必须在TortoiseGit中做两步操作才能提交到远程仓库:
第一步: Git提交(C)-> "master"... --这一步是提交到本地仓库, 相当于git commit -am "description message"
第二步: 推送... --这一步是提交到远程仓库, 相当于git push origin master:master
【注】: Git跟Svn不同,Git必须先提交到本地仓库再提交到远程仓库。
从远程仓库拉取文件到本地的命令格式: git pull origin master:master
[git@testagent git1]$ git pull origin master:master
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /home/git/server
4356801..a69dceb master -> master
4356801..a69dceb master -> origin/master
warning: fetch updated the current branch head.
fast-forwarding your working tree from
commit 4356801baf0cc3d83e29145384374cb4b6e30360.
Already up-to-date.
[git@testagent git1]$
删除仓库文件命令如下:
git add -u
git commit -m "delete test"
git push
Git服务器权限管理工具:
gitlab gitolite gitosis
/opt/rpmlib
[root@testgit rpmlib]# ls
asciidoc-8.6.9-1.el6.rfx.noarch.rpm gettext-devel-0.17-16.el6.x86_64.rpm
autoconf-2.63-5.1.el6.noarch.rpm libiconv-1.14.tar.gz
curl-devel-7.13.1-3.x86_64.rpm openssl-devel-1.0.1e-42.el6.x86_64.rpm
docbook2X-0.8.8-2.1.x86_64.rpm xmlto-0.0.18-4.x86_64.rpm
expat-devel-2.0.1-9.1.el6.x86_64.rpm zlib-devel-1.2.3-29.el6.x86_64.rpm
[root@testgit rpmlib]# rpm -q curl-devel
[root@testgit rpmlib]# rpm -ivh curl-devel-7.13.1-3.x86_64.rpm --nodeps
[root@testgit rpmlib]# rpm -q expat-devel
[root@testgit rpmlib]# rpm -ivh expat-devel-2.0.1-9.1.el6.x86_64.rpm --nodeps
[root@testgit rpmlib]# rpm -q gettext-devel
[root@testgit rpmlib]# rpm -ivh gettext-devel-0.17-16.el6.x86_64.rpm --nodeps
[root@testgit rpmlib]# rpm -q openssl-devel
[root@testgit rpmlib]# rpm -ivh openssl-devel-1.0.1e-42.el6.x86_64.rpm --nodeps
[root@testgit rpmlib]# rpm -q zlib-devel
[root@testgit rpmlib]# rpm -ivh zlib-devel-1.2.3-29.el6.x86_64.rpm --nodeps
[root@testgit rpmlib]# rpm -q perl-devel
perl-devel-5.10.1-119.el6_1.1.x86_64
[root@testgit rpmlib]# rpm -q asciidoc
[root@testgit rpmlib]# rpm -ivh asciidoc-8.6.9-1.el6.rfx.noarch.rpm --nodeps
[root@testgit rpmlib]# rpm -q autoconf
[root@testgit rpmlib]# rpm -ivh autoconf-2.63-5.1.el6.noarch.rpm --nodeps
[root@testgit rpmlib]# rpm -q docbook2X
[root@testgit rpmlib]# rpm -ivh docbook2X-0.8.8-2.1.x86_64.rpm --nodeps
[root@testgit rpmlib]# rpm -q xmlto
[root@testgit rpmlib]# rpm -ivh xmlto-0.0.18-4.x86_64.rpm --nodeps
要是没有gcc的相关编译器不能进行源码安装,下面是CentOS6上需要安装的gcc等相关rpm包:
cloog-ppl-0.15.7-1.2.el6.x86_64.rpm
cpp-4.4.6-4.el6.x86_64.rpm
gcc-4.4.7-16.el6.x86_64.rpm
gcc-c++-4.4.7-16.el6.x86_64.rpm
glibc-devel-2.12-1.166.el6.x86_64.rpm
glibc-headers-2.12-1.80.el6.x86_64.rpm
kernel-headers-2.6.32-279.el6.x86_64.rpm
libstdc++-devel-4.4.6-4.el6.x86_64.rpm
mpfr-2.4.1-6.el6.x86_64.rpm
ppl-0.10.2-11.el6.x86_64.rpm
[root@testgit opt]# tar -zxvf git-2.7.0.tar.gz
[root@testgit opt]# cd git-2.7.0
[root@testgit git-2.7.0]# autoconf
[root@testgit git-2.7.0]# ./configure --prefix=/usr/local
[root@testgit git-2.7.0]# make
[root@testgit git-2.7.0]# make install
[root@testgit git-2.7.0]# vi /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib --这一行是后加的,不加这一行在输入git --version的时候会报错
[root@testgit git-2.7.0]# /sbin/ldconfig
[root@testgit git-2.7.0]# git --version
git version 2.7.0
----------------------------------------------------------------------------------
下面是Git基本操作:
RPM包下载地址: http://rpm.pbone.net/index.php3/stat/21/year/2005/month/05/day/03
http://pkgs.org/download/
http://rpmfind.net/linux/rpm2html/search.php
如果你想从源码安装 Git,需要安装 Git 依赖的库:curl、zlib、openssl、expat,还有libiconv。 如果你的系统上有 yum (如 Fedora)或者 apt-get(如基于 Debian 的系统),可以使用以下命令之一来安装最小化的依赖包来编译和安装 Git 的二进制版:
$ sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel
$ sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev
为了能够添加更多格式的文档(如 doc, html, info),你需要安装以下的依赖包:
$ sudo yum install asciidoc xmlto docbook2x
$ sudo apt-get install asciidoc xmlto docbook2x
当你安装好所有的必要依赖,你可以继续从几个地方来取得最新发布版本的tar包。 你可以从Kernel.org网站获取,网址为https://www.kernel.org/pub/software/scm/git,或从 GitHub 网站上的镜像来获得,网址为 https://github.com/git/git/releases。 通常在 GitHub 上的是最新版本,但 kernel.org 上包含有文件下载签名,如果你想验证下载正确性的话会用到。
rpm -q gcc gcc-c++ glibc glibc-common glibc-devel
rpm -q libicu-devel patch gcc-c++ readline-devel zlib-devel libffi-devel openssl-devel make autoconf automake libtool bison libxml2-devel libxslt-devel libyaml-devel zlib-devel openssl-devel cpio expat-devel gettext-devel curl-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
rpm -ivh gettext-devel-0.17-16.el6.x86_64.rpm --nodeps
rpm -ivh libiconv-1.14-3.el6.x86_64.rpm --nodeps
tar -zxvf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local (或者#./configure --prefix=/usr/local/libiconv)
make
make install
接着,编译并安装:
$ tar -zxf git-2.7.0.tar.gz
$ cd git-2.7.0
$ make configure
$ ./configure --prefix=/usr
$ make all doc info
$ sudo make install install-doc install-html install-info
完成后,你可以使用 Git 来获取 Git 的升级:
$ git clone git://git.kernel.org/pub/scm/git/git.git
Red Hat Enterprise Linux 6.4源码安装Git服务器步骤如下:
rpm -q curl curl-devel zlib-devel openssl-devel perl cpio expat-devel gettext-devel
tar -zxf git-2.7.0.tar.gz
cd git-2.7.0
autoconf
./configure 或者 ./configure --prefix=/usr/local 或者 ./configure --prefix=/usr/local/git/
make
make install
[root@testagent lib]# pwd
/usr/local/lib
[root@testagent lib]# ls
charset.alias libcharset.so libiconv.la libiconv.so.2.5.1
libcharset.a libcharset.so.1 libiconv.so preloadable_libiconv.so
libcharset.la libcharset.so.1.0.0 libiconv.so.2
[root@testagent /]# vi /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib --这一行是后加的,不加这一行在输入git --version的时候会报错
[root@testagent /]# /sbin/ldconfig
[root@testagent git-2.7.0]# git --version
git version 2.7.0
[root@testagent git-2.7.0]# cd /usr/local/bin
[root@testagent bin]# pwd
/usr/local/bin
[root@testagent bin]# ls
git gitk git-shell git-upload-pack
git-cvsserver git-receive-pack git-upload-archive iconv
可以把Git服务加入到环境变量里:
[root@testagent /]# vi /etc/profile
export GIT_HOME=/usr/local/git/
export PATH=$PATH:$GIT_HOME/bin
创建Git仓库步骤如下:
[root@testagent git-2.7.0]# cd /
[root@testagent /]# useradd git
[root@testagent /]# passwd git
Changing password for user git.
New password:
BAD PASSWORD: it is WAY too short
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
[root@testagent /]# su - git
[git@testagent ~]$ ls
[git@testagent ~]$ mkdir mygitproject
[git@testagent ~]$ ls
mygitproject
[git@testagent ~]$ cd mygitproject/
[git@testagent mygitproject]$ ls
[git@testagent mygitproject]$ git --bare init
Initialized empty Git repository in /home/git/mygitproject/
[git@testagent mygitproject]$ ls
branches config description HEAD hooks info objects refs
[git@testagent mygitproject]$
https://git-for-windows.github.io/ 下载mysysgit
http://tortoisegit.org/download/ 下载TortoiseGit
先要clone一个.git文件夹到本地Windows机器
http://bbs.csdn.net/topics/390902529/
origin
git@192.168.3.56:mygitproject
http://blog.csdn.net/forever_wind/article/details/37506389
http://www.cnblogs.com/wang_yb/p/3867221.html
由于git默认拒绝了push操作,需要进行设置,修改.git/config添加如下代码:
[receive]
denyCurrentBranch = ignore
[git@testagent mygitproject]$ pwd
/home/git/mygitproject
branches config description HEAD hooks info objects refs
[git@testagent mygitproject]$ vi config
[core]
repositoryformatversion = 0
filemode = true
bare = true
[receive]
denyCurrentBranch = ignore
[git@testagent mygitproject]$ cat config
[git@testagent ~]$ pwd
/home/git
[git@testagent ~]$ git clone mygitproject git1
[git@testagent ~]$ git clone mygitproject git2
目前git branch是空的。我们提交一点东西建立master分支。
[git@testagent ~]$ cd git1
[git@testagent git1]$ pwd
/home/git/git1
[git@testagent git1]$ touch a.txt
[git@testagent git1]$ git add .
[git@testagent git1]$ git commit -m "init"
[git@testagent git1]$ git push origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 199 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To /home/git/mygitproject/
* [new branch] master -> master
[git@testagent git1]$ git branch -a
* master
remotes/origin/master
[git@testagent git2]$ pwd
/home/git/git2
[git@testagent git2]$ git pull origin
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /home/git/mygitproject
* [new branch] master -> origin/master
[git@testagent git2]$ ls
a.txt
[git@testagent heads]$ pwd
/home/git/mygitproject/refs/heads
[git@testagent heads]$ ls
master
[git@testagent git1]$ git commit -am "a.txt add : git1 user add nihao"
[master 4356801] a.txt add : git1 user add nihao
1 file changed, 2 insertions(+), 1 deletion(-)
本地分支提交到远程分支的命令格式: git push origin 本地分支:远程分支
[git@testagent git1]$ git push origin master:master
Counting objects: 3, done.
Writing objects: 100% (3/3), 277 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To /home/git/server
9e4111e..4356801 master -> master
Windows主机上修改了某个文件后必须在TortoiseGit中做两步操作才能提交到远程仓库:
第一步: Git提交(C)-> "master"... --这一步是提交到本地仓库, 相当于git commit -am "description message"
第二步: 推送... --这一步是提交到远程仓库, 相当于git push origin master:master
【注】: Git跟Svn不同,Git必须先提交到本地仓库再提交到远程仓库。
从远程仓库拉取文件到本地的命令格式: git pull origin master:master
[git@testagent git1]$ git pull origin master:master
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /home/git/server
4356801..a69dceb master -> master
4356801..a69dceb master -> origin/master
warning: fetch updated the current branch head.
fast-forwarding your working tree from
commit 4356801baf0cc3d83e29145384374cb4b6e30360.
Already up-to-date.
[git@testagent git1]$
删除仓库文件命令如下:
git add -u
git commit -m "delete test"
git push
Git服务器权限管理工具:
gitlab gitolite gitosis
发表评论
-
Linux下ZooKeeper集群搭建
2017-12-26 17:19 740shihuan830619@163.com邮箱的网盘里&quo ... -
RedHat7的非root用户调用xclock
2017-05-16 15:12 2113错误提示:Error: Can't open display: ... -
RedHat6.5用镜像文件配置yum源
2016-04-20 17:20 3294RedHat 6.5 x64位 [root@gyum ~]# ... -
realvnc使用
2016-03-23 17:19 1268远端实验服务器: RedHat 6.5 一、在Linux上安 ... -
java调用shell脚本
2016-01-26 00:53 1310附件java执行shell.rar里是已经下载好的jar包。 ... -
shell脚本编程
2016-01-26 00:13 849例1: 用vi编辑文件echodate ... -
Linux目录名称
2016-01-25 22:23 862[root@testgitlab /]# 这个是根目录 [ ... -
RedHat6.5在线安装GitLab
2016-01-22 21:09 2966https://gitlab.com/gitlab-org/g ... -
Linux安装ruby
2016-01-22 20:53 3313https://rvm.io/ 官方网站 https: ... -
验证RedHat6是否能够联网
2016-01-22 20:46 1102验证RedHat6是否能够联网: [root@testagen ... -
Linux非联网状态安装gcc依赖包
2016-01-22 20:43 3681cloog-ppl-0.15.7-1.2.el6.x86_64 ... -
Hadoop集群环境搭建
2015-12-11 17:09 1167最近学习了下hadoop的安装。下面详细说明下步骤。 一、环 ... -
Linux hosts文件参考内容
2015-11-11 17:13 1107127.0.0.1 localhost localhost ... -
shell命令学习资料
2011-12-04 19:14 1152附件里为Shell脚本学习资料。 -
Linux下WebLogic10.3的安装与配置
2009-10-10 18:45 24581WebLogic 10.3 安装、配置与管理手册 第二章 We ...
相关推荐
Linux系统安装Git服务器的过程中,涉及的知识点非常广泛,从基础的Git概念到具体的操作步骤,涵盖了对版本控制系统的理解,分布式与集中式版本控制的比较,以及在Linux环境下安装和配置Git服务器的详细过程。...
在给定的压缩包中,包含了Git的RPM包(Red Hat Package Manager)以及Git安装所需的其他依赖文件的RPM,这使得我们可以在没有网络的情况下完成安装。 离线安装步骤如下: 1. **准备环境**:确保你的Linux系统是...
1. **服务器端Git安装与版本确认:** - 安装Git: ```bash # yum install -y git ``` - 查看Git版本: ```bash [root@localhost ~]# git --version git version 1.7.1 ``` 2. **客户端Git安装与版本确认:**...
Linux离线安装git的安装及说明文档+所需依赖 依赖包如下: perl-TermReadKey-2.30-20.el7.x86_64.rpm libselinux-devel-2.5-15.el7.x86_64.rpm libselinux-2.5-15.el7.x86_64.rpm libcom_err-devel-1.42.9-17....
### Linux下搭建Git服务器步骤详解 #### 环境配置 - **服务器**: CentOS 6.6 + Git (version 1.7.1) - **客户端**: Windows 10 + Git (version 2.8.4.windows.1) #### 第一步: 安装Git 在服务器端与客户端上分别...
1 安装GIT 代码如下:$ sudo aptitude install git$ sudo aptitude install git-doc git-svn git-email git-gui gitk git软件包包含了大部分Git命令,是必装的软件包,第二行命令也是Git软件包,但是是单独发布的,...
在Linux环境下安装Git,通常需要解决各种依赖问题。这个离线安装包已经包含了所有依赖包,这意味着用户无需单独下载和安装这些依赖。这对于那些运行旧版Linux发行版(如这里的`el7`,可能是Red Hat Enterprise Linux...
(使用--prefix参数指定Git的安装路径,git默认的命令都安装在/usr/local/bin目录下,因此如果这里指定的目录非/usr/local/那么如果不设置相应的环境变量git将不可用。因此,尽量指定这个安装路径)
Linux 安装 Git 图文指南 Linux 安装 Git 可以通过两种方式实现:使用 yum 安装和自定义安装。下面将详细介绍这两种方法。 使用 yum 安装 使用 yum 安装 Git 非常简单,只需要输入以下命令即可: `yum install ...
【搭建Linux Git服务器】 在Linux环境下,搭建Git服务器是一个关键步骤,用于实现代码版本控制和团队协作。以下是如何在Linux上设置Git服务器的详细过程: 1. **创建Git服务器用户**: 首先,我们需要创建一个新...
如果您打算在麒麟Linux上部署Gitblit,需要确保Java运行环境(JRE)已经安装,并遵循Gitblit官方文档进行配置。 总结来说,Git2.7.4是一个强大且功能丰富的版本控制系统,这个压缩包包含了麒麟Linux上运行Git所需的...
### Linux下Git服务器安装配置详解 #### 一、前言 在Linux环境下配置Git服务器是一项常见但又重要的任务。本文将详细介绍如何在Red Hat Linux系统上安装并配置Git服务器,包括Git服务端软件的安装、基本配置以及...
2. **自定义安装路径**:默认情况下,`make install`会将Git安装到`/usr/local/bin`等目录下。如果希望更改安装路径,可以在`./configure`时添加相应的参数,例如: ```bash [root@localhost git-2.8.3]# ./...
### Linux环境下搭建Git服务详解 #### 一、概述 在Linux环境下搭建Git服务是一项非常实用且重要的技能。通过搭建自己的Git服务器,不仅可以更好地控制代码版本管理,还能够提高团队协作效率,减少网络延迟等问题。...
Git是分布式版本控制系统的一种,由Linux之父Linus Torvalds在2005年创建,主要用于Linux内核开发。Git的设计目标是速度、数据完整性以及支持非线性工作流,使得开发者可以在本地进行大量的提交和分支操作,而无需...
本教程将详述如何在Linux系统上安装并配置Git服务器。 首先,我们需要确保Linux系统已经安装了必要的基础软件包。通常,这包括SSH(Secure Shell)服务,因为Git通常通过SSH协议进行安全通信。大多数Linux发行版在...
Windows以及LInux下使用yum/apt安装git超详细图文
Linux下安装git
### Linux安装Git详解 #### 一、Git简介与重要性 Git是一款开源的分布式版本控制系统,主要用于跟踪在软件开发过程中的文件变化,并协助开发者管理这些变化。它支持快速且高效地处理从小规模到大规模的项目版本...