我试图同步一个项目,我在我的Android工作室文件夹到GitHub,但我不完全确定要做什么,除了在选项菜单中添加我的凭据。有人能给我简单介绍一下吗?
当前回答
在我使用的Android Studio版本(0.3.2)中,使用菜单就很简单。
VCS菜单> Git >共享GitHub。
然后它会要求您提供凭证,然后为您的新回购提供名称,就是这样!
其他回答
这并不局限于Android Studio,而是Intellij的IDEA的普遍行为。
转到:首选项>版本控制> GitHub
另外请注意,你不需要github集成:标准的git函数应该足够了(VCS > git, Tool Windows > Changes)
我第一次添加视频链接来解决你的问题,但我知道这是一个坏主意。这次我简单解释一下。
Android studio与github兼容,但你需要调整一些东西:
Setup Android Studio Setup the Github plugins in the Android Studio settings Android Studio settings >> Plugins page Download the git version control system from this link and setup https://git-scm.com/ After the installation, open Android Studio settings page and select the git.exe settings >> version control >> git Usually the path to git.exe is program files >> git >> bin >> git.exe Go to Settings >> Version control >> Github you will see login and password for your Github account. Apply the settings. For updating the project, go in Android Studio top line click VCS >> enable version control integration >> git One more time VCS >> import into version control >> share project on Github and enter your master password.
现在你可以使用VCS更新按钮将你的项目更新到Github
在Android Studio 1.0.2上,你只需要去 VCS->导入到版本控制->共享项目在GitHub。
弹出窗口将出现,要求回购名称。
Github和android studio
/*For New - Run these command in terminal*/
echo "# Your Repository" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/username/repository.git
git push -u origin master
/*For Exist - Run these command in terminal*/
git remote add origin https://github.com/username/repository.git
git push -u origin master
//git push -f origin master
//git push origin master --force
/*For Update - Run these command in terminal*/
git add .
git commit -m "your message"
git push
在Android Studio中打开要推送的项目。
单击“VCS ->启用版本控制集成-> Git”
似乎没有通过GUI添加远程的方法。所以在项目的根目录下打开Git Bash,执行Git remote add <remote_name> <remote_url>
现在当你做VCS -> Commit changes -> Commit & Push时,你应该看到你的遥控器,一切都应该通过GUI工作。
如果您得到错误:fatal: remote <remote_name> already exists,这意味着您已经添加了它。要查看您的远程执行git remote -v和git remote rm <remote_name>来删除。
详情请参阅以下页面:
http://www.jetbrains.com/idea/webhelp/using-git-integration.html
http://gitref.org/remotes/
推荐文章
- Android Studio中的。iml文件是什么?
- 如何在新的材质主题中改变背面箭头的颜色?
- androidviewpager与底部点
- 相同的导航抽屉在不同的活动
- 如何从视图中获得托管活动?
- 单一的TextView与多种颜色的文本
- 如何在非活动类(LocationManager)中使用getSystemService ?
- 在清单中注册应用程序类?
- Android:从数组中编程创建旋转器
- Android命令行工具sdkmanager总是显示:警告:无法创建设置
- 在另一个目录中运行操作
- GitHub克隆与OAuth访问令牌
- 如何设置RecyclerView应用程序:layoutManager=""从XML?
- 在没有开发服务器的情况下在设备上构建和安装unsigned apk ?
- 操作栏和新引入的工具栏有什么不同?