Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

git checkout firstcommit and then?

 
Giovanni Montano
Ranch Hand
Posts: 245
4
Android Open BSD Slackware
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as per subject I cloned a github project then I passed git checkout first commit to study how it is started, because is quite complex
and now via console what can i do to run the version in android studio and go trough the files?

I know there is also an inbuilt GIT but I need to learn from console.
 
Darryl A. J. Staflund
Ranch Hand
Posts: 314
2
Android Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

If the project uses Gradle to build the application (and many Git-based Android apps do), open Android Studio and 'Import project (Eclipse ADT, Gradle, etc.)'. Once you tell Studio where the project is located, it should be able to import the project itself. Then you should be able to run the project by pressing the Green Arrow in the toolbar. There's a lot more too it than this, but this should help you get started/

I cant help you with any other scenario, I'm afraid.

Good luck,
Darryl
 
Giovanni Montano
Ranch Hand
Posts: 245
4
Android Open BSD Slackware
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl A. J. Staflund wrote:Hi there,

If the project uses Gradle to build the application (and many Git-based Android apps do), open Android Studio and 'Import project (Eclipse ADT, Gradle, etc.)'. Once you tell Studio where the project is located, it should be able to import the project itself. Then you should be able to run the project by pressing the Green Arrow in the toolbar. There's a lot more too it than this, but this should help you get started/

I cant help you with any other scenario, I'm afraid.

Good luck,
Darryl

Thank you Darry,
but this is not sufficient. I know how to use Gradle. what I miss is how to launch and navigate in the app classes.IN other words how can I try the first commit of a cloned project
For an android sw developer that work with git should be quite trivial as reply, but I am just beginning with GIT console command line
 
Darryl A. J. Staflund
Ranch Hand
Posts: 314
2
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I guess I don't understand what you're asking. Git is a revision control system so you're not going to run the code using git from the command line. You can commit or push the code from the command-line, but that's a git task that's better asked in a different forum.

If you are looking to run the application using the Android SDK from the command-line, I've never really done it but documentation on how to use Android SDK's commmand-line utilities are available on the web. You can, however, run the application from within Android Studio by importing the Gradle project and then running it. That really doesn't involve git though.

Good luck.
Darryl
 
Giovanni Montano
Ranch Hand
Posts: 245
4
Android Open BSD Slackware
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl A. J. Staflund wrote:Hi there,

I guess I don't understand what you're asking. Git is a revision control system so you're not going to run the code using git from the command line. You can commit or push the code from the command-line, but that's a git task that's better asked in a different forum.

If you are looking to run the application using the Android SDK from the command-line, I've never really done it but documentation on how to use Android SDK's commmand-line utilities are available on the web. You can, however, run the application from within Android Studio by importing the Gradle project and then running it. That really doesn't involve git though.

Good luck.
Darryl


Darryl, I found the solution, and you were inspiring to me. It is a kind of grey area cause lot of people use the inbuilt GIT GUI inside intelliJ

here it is.

basically you clone your project
$clone blablabla@github.com
then you see the commits
$ git log

//and you see a list of commits
//then...
$ git checkout <hashcode you found from git log>//in my case the first commit>

then...
you just run the project( the green arrow or shift+f10) and automatically IntelliJ will load the current classes and will load the version you need!

when you are done with your previous commit you can revert to the final commit launching this command

$git checkout master

//and eventually check with git status, that the project is updated for educational purposes, but this step is not needed

so all in all you do not need to import any project, just working out the commands below and then run the project, and you will see the project directory populated with the current classes




 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic