git操作-add

==========git增加文件

git status

git add add2.txt

git commit -m "add test"

git push web

-----------at server

cd /var/www/foo.git;sudo git update-server-info

-----------added OK

http://[某ip]/gitweb/?p=foo.git;a=summary

------------检查增加效果

cd;rm foo3 -rf;git clone http://[某ip]/foo.git foo3

------------更新另一处已经存在的local code

cd;cd foo2

git remote add web [某user]@[某ip]:/var/www/foo.git/

git pull web master

==========git增加文件夹

git status

git status -s

git add d1

------------检查增加效果

cd;rm foo3 -rf;git clone http://[某ip]/foo.git foo3

#没什么反应。等下面再增加了文件,才会有反应。

#下面的commit进行时,自动把d1下面文件也commit了。

git commit -m "add dir test"

git push web

-----------at server

cd /var/www/foo.git;sudo git update-server-info

-----------added OK

http://[某ip]/gitweb/?p=foo.git;a=summary

------------检查增加效果

cd;rm foo3 -rf;git clone http://[某ip]/foo.git foo3

------------更新已经存在的local code

cd;cd foo2

git remote add web [某user]@[某ip]:/var/www/foo.git/

git pull web master


warm
warm

猜你喜欢

转载自bg090721.iteye.com/blog/1535497