git 使用例子

来源:互联网 发布:强行卸载软件 编辑:程序博客网 时间:2024/06/03 12:40

此文版权属于作者所有,任何人、媒体或者网站转载、借用都必须征得作者本人同意!

本地仓库

#仓库初始化hello@world:~$ su -l git密码: git@world:~$ cd /pub/data/02data/git/git@world:/pub/data/02data/git$ git init --bare myzone.git初始化空的 Git 版本库于 /pub/data/02data/git/myzone.git/git@world:/pub/data/02data/git$ exit注销#本地工作目录初始化及关联这个仓库hello@world:~$ cd /pub/job/research/hello@world:/pub/job/research$ mkdir myzonehello@world:/pub/job/research$ cd myzone/hello@world:/pub/job/research/myzone$ git init初始化空的 Git 版本库于 /pub/job/research/myzone/.git/hello@world:/pub/job/research/myzone$ touch README.mdhello@world:/pub/job/research/myzone$ git add README.md hello@world:/pub/job/research/myzone$ git commit -m "Add README.md file"hello@world:/pub/job/research/myzone$ git remote add origin git@localhost:/pub/data/02data/git/myzone.githello@world:/pub/job/research/myzone$ git push origin master对象计数中: 3, 完成.写入对象中: 100% (3/3), 236 bytes | 0 bytes/s, 完成.Total 3 (delta 0), reused 0 (delta 0)To git@localhost:/pub/data/02data/git/myzone.git * [new branch]      master -> masterhello@world:/pub/job/research/myzone$ git branch --set-upstream-to=origin/master#测试hello@world:~$ mkdir tmphello@world:~$ cd tmphello@world:~/tmp$ git clone /pub/data/02data/git/myzone.githello@world:~/tmp$ cd myzone/hello@world:~/tmp/myzone$ ls -al总用量 12drwxrwxr-x 3 hello hello 4096 2月 9 11:23 .drwxrwxr-x 3 hello hello 4096 2月 9 11:23 ..-rw-rw-r-- 1 hello hello 0 2月 9 11:23 README.md


0 0
原创粉丝点击