我试图同步一个项目,我在我的Android工作室文件夹到GitHub,但我不完全确定要做什么,除了在选项菜单中添加我的凭据。有人能给我简单介绍一下吗?
当前回答
在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/
其他回答
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项目仅仅使用GUI推到一个基于GIT的存储库的通用方法。这已经在Visual Studio Online托管的GIT存储库中进行了测试,并且应该与GitHub或任何其他基于GIT的版本控制提供商一起工作。
注意:如果您正在使用GitHub,“在GitHub上共享”是其他答案中所述的最简单的选项。
启用GIT集成插件 文件(主菜单)>>设置>>搜索GitHub集成
为项目启用版本控制集成 VCS(主菜单)>>启用版本控制集成>>选中“GIT”
将项目文件添加到本地存储库 右键单击项目>> GIT >> Add
提交已添加的文件 打开版本控制窗口(终端窗口旁边)>>单击“提交” 按钮 在提示窗口中选择“commit and push”
定义远程 在分析代码后,android studio将提示审查或提交代码 提交时将提示定义远程存储库。你可以 将url添加到GIT存储库。 然后输入存储库的凭据并单击“Ok”。(Visual Studio 在线用户需要启用“备用身份验证凭据”作为 此处提到登录到存储库)
Android Studio 3.0
我喜欢在Android Studio中这么简单。
1. 输入你的GitHub登录信息
在Android Studio去文件>设置>版本控制> GitHub。然后输入您的GitHub用户名和密码。(您只需执行此步骤一次。对于以后的项目,你可以跳过它。)
2. 分享你的项目
当你的Android Studio项目打开时,进入VCS >导入到GitHub上的版本控制>共享项目。
然后单击“共享”,单击“确定”。
这是所有!
我第一次添加视频链接来解决你的问题,但我知道这是一个坏主意。这次我简单解释一下。
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中获得当前前景活动上下文?
- 如何在Android中获取当前日期?
- 获取Android设备名称
- 在WebView中上传文件
- 加载HTML文件到WebView
- Android:为什么视图没有maxHeight ?
- 如何获得具有已知资源名称的资源id ?
- 在Android上将字符串转换为整数
- 为什么“System.out。”println“工作在Android?
- WebView显示err_cleartext_not_allowed尽管站点是HTTPS
- Android M权限:对shouldShowRequestPermissionRationale()函数的使用感到困惑
- 为什么构建类型与产品风味不同?
- GitHub -致命:无法读取用户名https://github.com':没有这样的文件或目录
- 我如何在一个片段中访问getSupportFragmentManager() ?