1. 程式人生 > >Version Control System using Git on Android Studio

Version Control System using Git on Android Studio

How to add a file to to your git?

To add a file to your git local repository Press Ctrl + Alt + A ( ⇧⌘A search git add)or Right click on the file you want to add then select Git -> Add. You can select the root folder of the project to add everything.

How to do a git commit?

To do a $git commit you press Ctrl + K

( ⇧⌘A search commit) then select the list of files which need to be committed on the commit changes dialogue and then enter the commit message then click on the commit button to make a commit.

Commit options

This dialogue allows you to select the files which you would like to commit

  • This will show you new files in green
    , modified files in blue and deleted files in grayed out color.
  • Optionally you can select Reformat code, Rearrange code, Optimize imports and Clean up on the fly before you commit
  • A click on the commit button will do a normal commit until you press the little down arrow to select other options like commit & push
    or Create patch
  • Click on the Details at the footer to see the changes for each file. You can even double click on the file to see the changes. To go through each changes you’ve made for each file one by one Press F7 or click on the UP or DOWN inside the Difference Viewer Dialogue like below
For mac users, Since I don’t know about the shortcuts I would recommend you to press ⇧⌘A to find the appropriate shortcut and type the search term given inside the parenthesis in this post for each shortcut. It is an easiest way if you don’t remember all the shortcuts

How to do a git push?

To do a $git push press Ctrl+Shift+K ( ⇧⌘A search git push), you will see the list of all your commit there. On the right side you can see the changes of the files you’ve made. Click on the Push button to make a git push to your remote repository.

Unfortunately at this point If you’ve not configured your remote repo to your git local repo, you can not add it using the IDE. You’ve to do that from your terminal. There is a feature request to jetbrains which is still open https://youtrack.jetbrains.com/issue/IDEA-87099
on terminal type $git remote add remoteName remoteUrl” to add remote repo as of now

Adding files to git, committing to git and pushing to remote might look like an easy job even from terminal at this moment. But the real power of Android Studio comes in when you take a pull with merge conflicts.

How to take a git pull?

Press Ctrl+T ( ⇧⌘A search git pull) a pop dialogue which says Update project will ask you to select the Update type and will give you an option to Clean working tree before update using stash or shelve method like below

Update your project
  • Merge: choose this option to have the merge strategy applied. The result is identical with that of running git fetch ; git merge or git pull — no-rebase.
  • Rebase: choose this option to have the rebase strategy applied. The result is identical with that of running git fetch ; git rebase or git pull — rebase.
  • Branch Default: choose this option to have the default command for the branch applied. The default command is specified in the branch.<name> section of the .git/config configuration file.

相關推薦

Version Control System using Git on Android Studio

How to add a file to to your git?To add a file to your git local repository Press Ctrl + Alt + A ( ⇧⌘A search git add)or Right click on the file you want t

Version Control System: Get up to speed with GIT

Version Control System: Get up to speed with GITGit WorkflowWhat is Git?Git is an open source distributed version control system used primarily for Source

GIT結合android studio使用總結

使用GIT前請閱讀(有git基礎可略過) git指引 :http://www.bootcss.com/p/git-guide/  一、 下載git    http://git-scm.com/download/   二、

gitandroid studio中重新關聯遠端倉庫地址的方法

今天用錯了個命令,被小坑了一把,滿滿都是淚啊 方法有三種: 1.修改命令 git remote set-url origin [url] 例如:Git remote set-url origin

SVN Version Control(1) --Installing SVN on CentOS

這次筆者帶來版本控制SVN的系列筆記。按照筆者的慣例,系列筆記的第一篇都是基礎的環境搭建,先不說太多抽象的知識,因為筆者習慣於在接下去的筆記中貫穿這些知識,潤物無聲,潛移默化,這是筆者所希望達到的層次。 1. Checking SVN whether ex

git關聯Android Studio以及上傳專案到GitHub

轉眼時間一晃就過去了,從事Android開發已有一年多的時間,由於專案忙,一直沒時間更新,雖然筆記做了很多,但是一直沒時間總結,只是把很多開發遇到的坑和知識點記在筆記本。這次來總結下android studio如何關聯git。 1、安裝git客戶端。 這

使用gitandroid studio下做版本控制

使用步驟很簡單 1.下載安裝git。 2.在as下配置git。 3. 選擇git。 4.配置忽略檔案:.gitignore *.iml .gradle /local.properties /.

gitAndroid Studio中的使用問題

git 在 Android中的使用問題: 問題1:我們知道,在Android Studio中可以直接使用git 從遠端倉庫中clone程式碼,但是我一直使用gitBash 的gui,一般都是先用git

GitAndroid Studio上的使用

1.Android studio關聯git 3.切換分支或master   5.合併分支:(需要切換到master上)   Ps:如果合併的時候有衝突,先解決衝突,然後add,com

GitAndroid Studio)專案提交更新到github詳細步驟及可能遇到問題

    在我們開發專案中有時我們想將專案釋出到github上,可能初次用會出現各種問題(配置環境,工具安裝),下面介紹一些總結和看大神的一些經驗,給大家分享下。      在此特別感謝啟蒙博主,奉

Version Control System

源代碼 錯誤 local 方法 另一個 最簡 軟件源 版本控制 tps 版本控制系統(version control system),是一種記錄一個或若幹文件內容變化,以便將來查閱特定版本修訂情況的系統。版本控制系統不僅可以應用於軟件源代碼的文本文件,而且可

android studio setting 中的Version Control 下面沒有 github和 git選項

最近準備把專案上傳的github上,結果按照網上的去測試  git和github是否已經test成功,測試成功之後,就再也沒有關這些,結果昨天準備上傳專案的時候 發現 標紅的兩項沒有了,尷尬。 好在android studio有提示  我按照提示   在setting  

Android Studio系列(三)使用Version Control管理多倉庫多分支原始碼

開發android系統原始碼的同學都知道,我們的工作都是很多人協同工作,因此git版本管理及歷史修改查閱異常重要!甚至比開發app重要的多! 此文旨在介紹一下用AS中自帶的Version Control工具來管理android系統原始碼,鑑於android原始

Android Studio解決unspecified on project app resolves to an APK archive which is not supported

class resolv -s error support ive repl size projects 出現該問題unspecified on project app resolves to an APK archive which is not supported as

[轉]Android Studio啟動時出現unable to access android sdk add-on list

上大 ras server tails dea tar ext ida 錯誤信息 轉載請標明出處:http://blog.csdn.net/xx326664162/article/details/50563122 文章出自:薛瑄的博客 你也可以查看我的其他同類文章,也會讓你

Android StudioGit和GitHub使用詳解

可能 必須 窗口 gin 擁有 說明 詳細 對話 發現   一、Git和GitHub簡述    1.Git    分布式版本控制系統,最先使用於Linux社區,是一個開源免費的版本控制系統,功能類似於SVN和CVS。Git與其他版本管理工具最大的區別點和優點就是分布式;  

打開Android Studio時報Unable to access Android SDK add-on list

打開 title 而且 tex 技術 src access -o 下載安裝 第一次安裝Android studio時候彈出unable to access android sdk add-on list原因是你電腦沒有SDK而且你下載的android studio又是不

ionic3打包出錯ionic cordova build android(系列一):could not find an installed version of gradle either in android studio

lan 問題 打包 fail .html ascii failed contains ref 1.運行ionic cordova build android 時報錯:could not find an installed version of gradle either i

第七章 : Git 介紹 (下)[Learn Android Studio 漢化教程]

features 發布 double to do oda 日誌功能 測試 相關 rds Learn Android Studio 漢化教程 Let’s reset even further to remove all traces of your work on

android studio run 的時候,報the apk file does not exist on disk,

bsp mage gpo 重啟 build log nbsp oid alt 1.首先 clean rebuild,重啟,不能解決的話,再找到這個 然後是這裏: 不用填,點ok,ok即可,他喵的,卡我倆小時 android studio run 的時候,報the a