eclipse与github建立版本关联、git使用说明
1.在eclipse下建一个project :aa
2.打开git bush,进入aa目录下:cd /d/MyWorkspace/aa
3.git init
4.git add -A
5.git commit -m "aa test"
6.git remote add origin https://github.com/username/aa.git
7.在https://github.com网站新建一个库,库名为上面的aa
8.按提示输入用户名、密码
9.git push origin master
只要这9步就可以实现github与eclipse间关联,可以轻松开发及版本管理。
修改代码,向远程库提交:
1.git add -A
2.git commit -m "aa test 2"
3.按提示输入用户名、密码
4.git push origin master
Git 常用命令使用
命令行里git的命令列表以及解释:
git clone <address>:复制代码库到本地。git add <file> ...:添加文件到代码库中。git rm <file> ...:删除代码库的文件。git commit -m <message>:提交更改,在修改了文件以后,使用这个命令提交修改。git pull:从远程同步代码库到本地。git push:推送代码到远程代码库。git branch:查看当前分支。带*是当前分支。git branch <branch-name>:新建一个分支。git branch -d <branch-name>:删除一个分支。
git checkout <branch-name>:切换到指定分支。git log:查看提交记录(即历史的 commit 记录)。git status:当前修改的状态,是否修改了还没提交,或者那些文件未使用。git reset <log>:恢复到历史版本。
浙公网安备 33010602011771号