Who is doing Git?

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Who is doing Git?

Post by atostaine »

I did a fresh SP2 install today and set it up as independent with VCS. I started following this https://docs.lansa.com/14/en/lansa011/c ... 2_0285.htm but got sidetracked. It mentions AWS and I'm not sure why I need a cloud provider. I thought I could signup with Git and put my code there.

In case you didn't figure it out, I'm a total noob about this. If I make it to the end and get this to work I'll share.

Art
Art Tostaine
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Who is doing Git?

Post by jyoung »

You don't need AWS. All you need is git and if want to share code an online repository like Github, Bitbucket, Gitlab etc. makes it easy.

If all you are doing is playing with the VCS, you don't need an online repository, just git on your PC. You can always add and online repo later, you use the `git add remote` command.

Git in itself can be mind melting, although if you invest some time in learning it, it will pay off.

If you have not found them already check out the git docs https://git-scm.com/docs.

We don't currently use it for LANSA dev right now, but its on our list of things to transition to .... eventually. lol.
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: Who is doing Git?

Post by atostaine »

Ok that clears it up a bit. I'm going to fool with it tonight.

Art
Art Tostaine
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: Who is doing Git?

Post by atostaine »

I'm using this doc, it says right click active partition and say "populate working folder". I don't have that option

https://docs.lansa.com/14/en/lansa011/c ... ADM02_0255

From Doc:
git.png
git.png (30.67 KiB) Viewed 23272 times
My options are create folder, rename folder, show in windows explorer. Any ideas?
Art Tostaine
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Who is doing Git?

Post by jyoung »

I think that's an old doc.

Make sure you enabled in Settings. File -> Options -> Version Control
Capture1.PNG
Capture1.PNG (44.64 KiB) Viewed 23268 times
Then in Version Control window, you should be able to right click the Partition, Version Control -> Create Git Repository
Capture2.PNG
Capture2.PNG (27.55 KiB) Viewed 23268 times
You can also do it with just git,right click on the Partition (in the Version Control window) show in Windows Explorer.
The in the folder, right click and Git Bash here.
Capture3.PNG
Capture3.PNG (57.7 KiB) Viewed 23268 times
Then type git init in the git bash window. I do think you have to restart the IDE to get it to pickup change though.
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: Who is doing Git?

Post by atostaine »

Thank you for the response. Wlill try tomorrow
Art Tostaine
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: Who is doing Git?

Post by atostaine »

I was able to do the git bash way. I can right click a component and save add to version control.

I go into Git extensions and open the repository but it shows nothing. How can I view the repository in GIT?

Thanks
Art Tostaine
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Who is doing Git?

Post by jyoung »

Git works off the file system so the first question is do you see the YAML (*.yml) file in the version control folder?

Git requires two things to add a file to the repository. You have to first "stage" the file, then you have to "commit" the file.

I don't use Git Extensions so I am not sure how that will look, but if you are in Git Bash partition level you and use `git status`. I am using backticks ` to note the whole command.
This will show untracked files. Here I don't have anything committed yet, so I would not see anything in Git.
bash.PNG
bash.PNG (33.14 KiB) Viewed 23245 times
Now I can use `git add .` (note the period!) and then `git status` again. This is "staging" the files. You can have different actions staged before a commit. Things like new files, deleted files etc. Here the files have been added but NOT committed yet.
git add.PNG
git add.PNG (37.82 KiB) Viewed 23245 times
Then you can use `git commit -a -m 'my commit message'`
git commit.PNG
git commit.PNG (48.45 KiB) Viewed 23245 times
Now git knows about the files and has them in its index. You should be able to see them in any Git tool you are using including Git Extensions.

Hope this helps,
Joe
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: Who is doing Git?

Post by atostaine »

Thanks again Joe. Looks like it's working.

I was able now to go to LANSA and add another RP, then use the Git extensions that LANSA installed and commit it. Thanks!
Art Tostaine
anthony
Posts: 3
Joined: Tue Mar 22, 2016 3:58 pm

Re: Who is doing Git?

Post by anthony »

Hi Art,

you can also commit an object from inside the Visual LANSA IDE.
https://docs.lansa.com/14/en/lansa012/i ... l_0080.htm

Anthony
stevelee67
Posts: 22
Joined: Tue Mar 13, 2018 8:25 am
Location: Madison WI

Re: Who is doing Git - and how does it get enabled?

Post by stevelee67 »

i upgraded to 14.2 a few days ago and don't even see version control as an option. is this going to require a whole new install or is there another way to get this feature added?
The path to wisdom does, in fact, begin with a single step. Where people go wrong is in ignoring all the thousands of other steps that come after it.
Hogfather (Terry Pratchett)
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Who is doing Git?

Post by jyoung »

Did you do an upgrade of a slave setup?

If so, the option will not show up.

I did separate install for the VCS setup.
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: Who is doing Git - and how does it get enabled?

Post by atostaine »

stevelee67 wrote: Tue Jul 10, 2018 5:56 am i upgraded to 14.2 a few days ago and don't even see version control as an option. is this going to require a whole new install or is there another way to get this feature added?
Upgrade won't let you change the type of installation. You need to do a new install.
Art Tostaine
Post Reply