4. 配置git管理仓库
3. 配置git管理仓库¶
3.1 本地有代码的情况¶
先进入需要管理的代码目录(比如/cp_git/git00),然后执行git init,生成代码库
[root@chupeng git00]# ls -a
. ..
[root@chupeng git00]# cd /cp_git/git00 && git init .
Initialized empty Git repository in /cp_git/git00/.git/
[root@chupeng git00]# ls -a
. .. .git
3.2 本地没有代码的情况¶
1.可以直接创建管理代码库
[root@chupeng ~]# git init /cp_git/git01
Initialized empty Git repository in /cp_git/git01/.git/
[root@chupeng ~]# cd /cp_git/git01/
[root@chupeng git01]# ls -a
. .. .git
2.也可以下载别人的代码库
[root@chupeng git02]# ls -a
. ..
[root@chupeng git02]# git clone https://gitee.com/helyho/DockerFly.git
[root@chupeng git02]# cd DockerFly/
[root@chupeng DockerFly]# ls -a
. bin conf Dockerfile lib README.md start.sh
.. classes docker-compose.yml .git LICENSE src WEBAPP
最后更新:
2022-02-18 11:26:47