Git常用命令

1.配置好Git,创建ssh key进行测试:

ssh -T [email protected]

2.Clone别人的项目:

Git clone  https://github.com/licaomeng/Android-PullToRefresh-SwipeMenuListView-Sample.git

3.上传自己的项目到github

先进入你的项目的根目录下,右键git bash,进行如下操作:
git init
git add .
git commit -m 'initial commit'
git remote add origin https://github.com/licaomeng/Android-PullToRefresh-SwipeMenuListView-Sample.git
git push origin master
如果执行
git remote add origin origin https://github.com/licaomeng/Android-PullToRefresh-SwipeMenuListView-Sample.git
出现错误:
fatal: remote origin already exists
则执行以下语句:
git remote rm origin

4.修改项目后,重新上传到Github:

git rm -r --cached .
git add .
git commit -m 'second commit'
git push origin master


你可能感兴趣的:(github,git,github常用命令,github重传,github上传)