Git的使用
来源:互联网 发布:linux 匹配文件内容 编辑:程序博客网 时间:2024/06/06 09:49
使用Git管理自己的代码
使用Git维护自己的代码,简单的使用:
- 在码云上创建新项目(GitHub有点慢)
- 创建本地 git 仓库
- 将远端服务器上的仓库clone到本地
- 新增文件并提交
- push到远程仓库
在码云上创建新项目
找到新建项目,然后随便新建一个
创建本地 git 仓库
1 在本地新建一个目录,然后通过Git客户端进入到该目录
2 执行命令:git init
Administrator@WIN-P1RL8B7ODIV MINGW64 /c/git$ mkdir weixxAdministrator@WIN-P1RL8B7ODIV MINGW64 /c/git$ git initInitialized empty Git repository in C:/git/.git/
如图:
将远端服务器上的仓库clone到本地
1 现在项目界面上,找到远程仓库地址
2 现在项目界面上,找到远程仓库地址
3 通过git客户端进入到本地仓库 目录下,并执行命令:
git clone https://gitee.com/weixx3/weixx.git <– 这是远程仓库地址
Administrator@WIN-P1RL8B7ODIV MINGW64 /c/git (master)$ git clone https://gitee.com/weixx3/weixx.gitCloning into 'weixx'...remote: Counting objects: 101, done.remote: Compressing objects: 100% (91/91), done.remote: Total 101 (delta 4), reused 0 (delta 0)Receiving objects: 100% (101/101), 64.51 KiB | 0 bytes/s, done.Resolving deltas: 100% (4/4), done.
如图:
新增文件并提交
1 到 本地仓库目录下 新增一个文件 change.log
Administrator@WIN-P1RL8B7ODIV MINGW64 /c/git/weixx (master)$ lschange.log LICENSE pom.xml README.md src/ weixx.log
2 执行命令:git status
Administrator@WIN-P1RL8B7ODIV MINGW64 /c/git/weixx (master)$ git statusOn branch masterYour branch is up-to-date with 'origin/master'.Untracked files: (use "git add <file>..." to include in what will be committed) change.lognothing added to commit but untracked files present (use "git add" to track)
3 执行命令: git add change.log
4 执行命令: git commit 会进入如下界面 让输入 提交说明,然后:wq保存退出
这时候只是提交到了本地仓库,并没有提交到远程仓库,所以远程仓库上还没有
5 执行命令:git push
$ git pushCounting objects: 3, done.Delta compression using up to 4 threads.Compressing objects: 100% (2/2), done.Writing objects: 100% (3/3), 276 bytes | 0 bytes/s, done.Total 3 (delta 1), reused 0 (delta 0)To https://gitee.com/weixx3/weixx.git 1da96f1..377ffcd master -> master
这样就提交到 远程仓库了上
阅读全文
0 0
- git的使用 git命令
- 【Git使用详解】Git的使用心得
- Git管理工具的使用
- git的使用
- git hub 的使用
- git工具的使用
- git的使用
- git的使用
- git的使用。
- git 的使用
- git的简单使用
- git的简单使用
- GIT的基本使用
- git 的使用
- git的使用
- git repo的使用
- git的使用
- git的使用
- 在ubuntu 16.04上安装opencv和opencv_contrib
- 关于算法的时间复杂度
- 【poj1852】Ants 乱搞
- macOS安装homebrew命令
- redis之持久化(12)
- Git的使用
- hibernate 报错Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
- 巩固与修炼(三)
- 微信公众号开发日志(一)
- Java 自定义异常
- 重叠相加法和重叠保留法的原理
- 1378 求三个数组中的共同元素 C语言
- spring与jdbc的结合的示例
- 用GDB调试程序(一)