Setup a development environment git + centos + Eclipse egit on windows - eclipse

I am setting up a development environment in my home. I have installed a centos linux in a virtual machine. All files in /var/www/html are shared with samba.
I have access to these files in windows. I have installed git in centos. I created a git repository in a sub directory of /var/www/html.
I am using Eclipse in windows. Egit is installed in Eclipse. I tried to add repository in eclipse but when I do a commit in egit, "git status" in linux displays a list of modified files to commit. Also when I do a commit in linux, all files in egit will be marked az modified.
I don't know how to synchronize egit with git. What is the correct way to do this?

The easiest solution by far would be to use a cloud service such as GitHub (or BitBucket if you want free private repositories).
An example workflow is (on terminal, however your clients will have GUI options for this):
$ git remote add origin git#bitbucket.org:username/repository
$ git push origin master
The on your other client fetch the changes and merge them in through pull
$ git pull
Both sides will need to have the same remote repository - This way you can push - pull wherever you do the work and the code be the same. I use this setup for developing and deploying my web-apps.
This solution relies on you having an internet connection - if you dont want or dont have an internet connection at your disposal then have a look at this post:
gitosis vs gitolite?

Related

Eclipse Plugin for Full Remote Development

Are there any Eclipse plugin allowing a full remote development (including using git installed on the remote machine) as the "Remote Development" extension does for VS Code ?
Git is implicitly designed to work with remote git repositories, but it still does require a local git repository and git toolset. You can use the "eGit" plugin set already installed in Eclipse to "clone" from remote git repositories to your desktop. You don't need additional plugins for this.

Rstudio: Changing origin for git version control of project

I originally set up git in Rstudio while enrolled in the Data Scientist's Toolbox course at Coursera. Unfortunately, I did this in my phd project. The repository no longer exists on github. I am now attempting to write my thesis in rmarkdown using knitr and bookdown. I would like to use version control, both to learn proper git workflow and to have a structured back up of everything I have done in my thesis. However, I have been unable to change the version control repository in Rstudio.
I am unable to change this in the Tools > Version control > Project setup > Git/SVN menu. The Origin: textbox is unchangable.
I tried creating a new project using the old phd project's working directory. This also cloned the version control settings.
How do I change the origin to accomplish what is described above?
Git, Github and Rstudio are different things. You could use git as local version control tools. You might connect your local repo to Github account which is based on git by push/pull. Rstudio just makes a user interface for git and supplies the function to push the repo into remote server based on git to make version control(not only Github, but also Gitlab).
So for your issue, if you do not want to pay for github for a private repo, all of your code would be public and I don't think it is good before your finally finished your thesis. But version control could be made locally with git only. Just use git shell to control the version.
However, as a student, github could support private repo here for you. Just register and find your student package. Then just remove the url for remote repo after you cd to your workdir in command line, use the following code to find your remote url(mostly you might fing origin):
git remote -v
Then use this to remove them:
git remote rm origin
Now you could use version control locally. If you want to connect this repo to your remote github private repo, use this:
git remote add origin https://github.com/[YourUsername]/[YourRepoName].git
RStudio would find this information about git and support your following operation. Project in RStudio is different with git, although project support git as version control tool. So you need git in command line or shell to solve your problem.
This can be done by opening /your.project/.git/config
and editing the remote origin line(s), e.g. changing from git to https.
Restart Rstudio & you'll be prompted for your github username & password.
This is what worked for me for migrating from github to Azure
Go to the top right Git window in RStudio and click on the gear. Now click Shell (to open the terminal there).
#remove origin
git remote rm origin
#add new origin like Azure for me via HTTPS
git remote add origin https://USER#dev.azure.com/USER/PROJECT/_git/REPONAME
#push your local repro
git push -u origin --all
#in my case put in the PAT password if you needed to generate one.
After testing, I found some clue
Actually Rstudio is not really smart about this setting
It will first search for the git file in the Rproject folder where your Rporject file is located
if it could not, then it goes up to the folder contains your Rproject folder
However, for version control you only need coding files while RProject may contains some big files like .RData some pictures etc.
I don't find a way to manually disrupt this logic flow, the only thing you can do is to delete the current git repository setting files(which is .git folder and 2 other git setting files), then Rstudio may ask you if you want to init a new one.

egit plugin for Eclipse

I have created a gitlab repository and followed the installation instruction by the letter and it was successful (i think... i can browse the repository online) and now I want to connect the egit plugin from eclipse to this remote repository.
I was using SVN for quite some time and now we need to switch to git and I am confused. egit only gives me the option to create a local repository but I'm a bit lost on how to push/fetch code to my online repository.
Any advice will be greatly appreciated :)
Thanks!
With Gitlab (working with ssh urls), that means you have to register your public and private ssh key in Egit first before being able to clone it.
See EGit ssh configuration
Then you can clone it.
And yes, you need to clone the full repo locally to work on it, that is the difference between a:
CVCS (Centralized Version Control System) like SVN
DVCS: Distributed Version Control System.
See "Sell me Distributed revision control" and "Describe your workflow of using version control (VCS or DVCS)" for more.
First you need to clone the remote repository using git clone <repository>, then you can import it to eclipse using egit
Or
You can use the clone functionality provided by EGit to clone the remote repo to local system

How to clone mercurial repository created by eclipse plugin in other laptop?

My colleague created mercurial repository by eclispe plugin(http://javaforge.com/project/HGE)(right click project root->team->share with->mercurial....) in hist laptop with ip address:192.168.0.111,the question is how I can clone his repository use same plugin in eclipse.
For cloning, you need access via either ssh or http (or some other mechanism provided by a plugin). If your colleague is running a Linux or OS X system, he could run an SSH server on his box and create an account for you, so that you'd be able to clone his repository over ssh. The easier solution, which also works on Windows, is for your colleague to run hg serve in his Mercurial repository (I don't know if the Eclipse plugin has an option for that), which will run the embedded webserver. By default, you should then be able to clone from http://192.168.0.111:8000/ (the hg serve command has options to run it on another port).

Using Git With Eclipse Remote Systems Explorer

I am doing web development using CFEclipse with Classic Eclipse (Indigo) on a Windows Server.
I am using Remote Systems Explorer to access a Linux box via sftp.
The Linux box has Git installed. There is one branch in the development folder.
I have installed EGit in Eclipse, but there are no provisions for working with a remote system.
Because I cannot develop locally, how should I checkout files, edit and review changes in a browser, and ultimately commit properly? There is no local repository and checking out files through ssh (putty) while editing them in Eclipse does not show my changes when browsed.
If you can access to the remote location through ssh why you don't just simply clone the repository in local and then pull and push the changes ?
I think that cloning the the repository is the best bet in your situation, you have only to install msysgit on your windows machine ...
You can use remote project to achieve what you need. Unfortunately, git operations need to be done on the remote server. But, you can change the files and the files will be changed remotely on fly. To create the remote project you have to right click on the remote folder you want to create the remote project. The context menu you will find "Create Remote Project".
What Eclipse will do is make the modification thru RSE. This means, eclipse will deal with save files remotely.