使用 git 命令行工具创建一个 Android 工程
workspace: 本地的工作空间。
index:缓存区域,临时保存本地改动。
local repository: 本地仓库,指向最后一次提交HEAD。
remote repository:远程仓库。
新建仓库
新建仓库
new Repository
Create a new repository
安装 Git
Window 安装
Git for Windows、TortoiseGit,或安装类 UNIX 模拟环境 Cygwin。
Linux
$ yum install git-core #在 redhat 等系统下用 yum
$ apt-get install git-core #在 debian, ubuntu 等系统下用 apt-get
1
2
3
Mac OS
方法一:homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # Install Homebrew (OS X 10.10 or higher)
$ brew install git
1
2
方法二:AppStore 安装 Xcode,Xcode 集成了 Git
“Xcode”–>“Preferences”–>“Downloads”–>“Command Line Tools”–>“Install”
验证
$ git --version
SSH 配置:
$ ssh-keygen -t rsa -C "user.email" # 生成秘钥
1
这里不要设置密码,直接按回车就可以,以后更新就不需要密码
生成秘钥
windows 系统在目录 C:\Users\用户名.ssh
复制 ~/.shh/.is_rsa.pub 内容到
Account Settings —> SSH Public keys —> add another public keys
测试连接
Windows 7下 Git SSH 创建 Key 的步骤 | 星空武哥
从远程仓库克隆一个版本库
git-clone
新建 Android 项目
查看项目结构
查看仓库当前状态并将文件改动提交到缓存区域
git add .;git status
git commit
git push
An-Android-Project
原文链接:点击这里
- 分享
- 举报

-
浏览量:1282次2023-12-21 17:20:27
-
浏览量:6175次2021-12-10 16:15:34
-
浏览量:2165次2020-08-14 18:15:32
-
浏览量:6523次2020-08-30 12:34:17
-
浏览量:1961次2019-12-03 16:21:12
-
浏览量:2502次2020-09-30 18:11:55
-
浏览量:6247次2017-12-12 21:37:12
-
浏览量:1104次2023-04-19 09:11:57
-
浏览量:2323次2022-03-22 09:00:12
-
浏览量:6690次2022-05-30 15:26:15
-
浏览量:513次2023-11-15 15:54:49
-
浏览量:1632次2023-04-13 10:45:45
-
浏览量:14026次2020-12-09 09:53:36
-
浏览量:11582次2020-12-16 17:38:28
-
浏览量:1945次2020-08-19 17:00:36
-
2023-02-15 10:31:45
-
浏览量:583次2023-10-08 17:57:29
-
浏览量:4386次2021-08-26 14:50:36
-
浏览量:3269次2023-12-21 11:18:25
-
广告/SPAM
-
恶意灌水
-
违规内容
-
文不对题
-
重复发帖
TT_123456789






举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明