git 强大的版本控制工具。ubuntu上安装git只需一句代码。通常结合repo 一起使用。
apt-get install git
一、Git配置(只需配置一次)
git config --global user.name <username>
git config --global user.email <email>
注:因为Email用户名和系统用户名有可能会不一致,为避免未来向服务器提交修改出现权限错误,还需要以下配置(git提交的服务器地址)
git config --global review.192.168.1.21:8081.username <username>
二、Configure SSH Configure (One-Time Only)
IMPORTANT: You should only generate an SSH key ONCE. If you already have an SSH key that you use
for other applications, just use that key for this access.
1. Make sure you are not logged in as the Root user.
2. Open a terminal window.
3. Type ‘& ssh-keygen -t rsa’
4. Press Enter for the default questions.
5. Change to your .ssh folder: ‘$ cd ~/.ssh’
6. Edit (or create) a file called ‘config’ in this folder.
7. Add the following section to the file:(地址和端口例子)
host 192.168.1.21
port 29418
user < username used to log into server >
8. Save the file and exit.
三、 Upload your ssh public key to server
IMPORTANT: You should only generate an SSH key ONCE. If you already have an SSH key that you use
for other applications, just use that key for this access.
四、Getting the Source Code
Now that you have a tunnel to the server you can open a terminal window and issue commands to that server. Here are the steps to pull the Android source.
1. Make a base directory to pull the source into. Type ‘ mkdir mfld’
2. Change into that directory. Type ‘ cd mfld’
3. Run Repo init. Type ‘ repo init -u ssh://192.168.1.21/manifest ’
4. Run a Repo Sync to pull the entire source. Type ‘ repo sync ’
5. Once this is complete you will have a complete Android source tree with both Intel Source and Google Android AOSP source merged into your local workspace.
常用git命令 列表 :
add am apply branch checkout clone commit config diff format-patch
init log pull push reset revert rm stash status
一般做完修改提交只需 git status => git diff => git add =>git commit => git push
当然参数没给出。更详细的教程点击下面链接。