ΠŸΠ¨Π• AndroidStudio or how to use VCS Tools to the fullest

AndroidStudio or how to use VCS Tools to the fullest


-  ,      .
- ...?

Approximately this reaction was with me after receiving the first investment request pool in the first week of work in one large company. The reason for this reaction is very simple - not every customer / employer can afford such a luxury as a large team on one platform, especially mobile development. Due to the uselessness and the possibility of fast communication in your world, not all the things that large masters use in their field gain relevance in small teams. Simply put - why the hell do I need it if we already lived well and coped well without it?


After moving to a new company, I encountered the same problem, but on the other side of the barricades. If you have not figured out what will be discussed further, this is GIT, more precisely, its built-in tools in AndroidStudio and how it makes our work easier.


I will try to ignore the commonplace things: init VCS; new / rename / push branch; rebase / merge onto branch; setup remotes etc I will try to draw attention to those elements that, for fear of my ignorance, I have avoided for a long time (and regret).


Amend commit


In the case when you decide to supplement your changes to the last commit, you should use the following command:


//       
git commit --ammend
//      
git commit --ammend "New commit message"

And you can speed up the process:


image


Edit commit message


, PR , , , :


image


Interactive rebase


. , N . , / .


, , … , .


, .


//    
git cherry master -v 
//     
git cherry master | wc -l 

GUI:


image


tools:


image


, :


git-rebase-2

e :


image


:


image


:


image


:


# Commands:
#  p, pick =  (  )
#  r, reword =  ,    
#  e, edit =  ,   amend-( )
#  s, squash =         
#  f, fixup =  ,   (    )

, . ? , .


image


Force push .


Multiple remotes


, , , .


image


? 2 (, ), / :


image


Git blame


:


image


. , IssueNavigationLink:


//    
<PROJECT_ID>-<TASK-ID>: <COMMIT MESSAGE>

( , git-hooks β€” https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)
project/.idea/vcs.xml:


image


:


<IssueNavigationLink>
    <!--      -->
    <option name="issueRegexp" value="([A-Za-z]+\-)(\d+)" />
    <!--    -->
    <option name="linkRegexp" value="https://github.com/IlyaPavlovskii/Android-Environments/issues/$2" />
</IssueNavigationLink>

ID.


image


Git cherry-pick


cherry!


, /, , . , , - , . , … , 1 ( ). ?


image


image


:


image



In conclusion, I would like to immediately recall the eternal holivar on the topic: terminal or GUI editor for working with VCS? It's a matter of taste. It’s clear that CLI GIT is a more powerful tool for specific tasks without it. But for everyday tasks, the built-in utility package for working with version control systems in AS is just a must have and will reduce development time by several times.
I hope that you have found something new in this article and helped ease your work routine.


All Articles