Is it possible to use Git extension or Git GUI to manage the files on a remote linux ftp server like a local repository - linux

I have my site stored on a remote Linux server and I use FTP to download, edit, and re-upload them. I am currently able to use the git bash to connect and upload the files (like a local repository) to bitbucket (my remote repository) but I was wondering if its possible to use one of the graphical git programs to connect to the server and be able to push/pull/manage the changes just to make my life simpler.

If you have a local clone of that Linux server repo, you can use it in combination of any GUI (SourceTree, GitKraken, Tower, ...) installed locally.
That is easier than trying to install a GUI in an environment where you only have headless (ie shell or ftp) access.

Related

Solution for Git GUI client for remote SSH

I am a Git GUI user. I don't have an issue using it for my local development. However, now we have a server with a Git repository. Can I remotely push, pull and diff by using the Git GUI client to access that?
Currently, I am SSHing to the Linux server, and use a Git command to do all the Git commands. But I found it very difficulty when it comes to diff. That's why I think is there any solution for me using the Git GUI client access remote repository and do the Git command with a Git client.
I want to be able to mount a remote server in a Git repository.
Current we only have to open the Git repository in our local disk. For example, the C:\www\repo.git file. How about if I want to access 10.10.10.10/home/www/.git and do all the Git commands in the Git client?
Solutions are open for OS X and Windows.
Aside from VNC / remote X (which is an obvious solution and therefore not worth putting in an answer), the only alternative I can find is Visual Studio Code's new remote development support.
You can connect to a server via ssh (from within Visual Studio Code), and then Visual Studio Code's Git features work natively. The interface is fairly basic however - in particular there is no history view and you can't rebase, cherry-pick, etc. from the GUI. It's basically for staging commits.
This extension gives you a proper git graph view. It's pretty good.
If your server has it enabled, you can use XForwarding to display a GUI executed on the remote machine on your local machine.
On the server-side, this means that you need to have the proper tools installed (e.g., git-gui, which means that you also need Tcl/Tk installed, which means that you also need the X infrastructure installed).
You also must enable Xforwarding, by making sure that you have a line like the following in your /etc/ssh/sshd_config:
X11Forwarding yes
To use that on your local Linux machine, you would usually use the -X flag to enable XForwarding for a given connection:
shiro#local:~$ ssh -X gituser#gitserver
gituser#gitserver:~$ cd repo.git
gituser#gitserver:~/repo.git$ git gui
On your local OS X machine, you would instead use -Y:
shiro#applejoice:~$ ssh -Y gituser#gitserver
gituser#gitserver:~$ cd repo.git
gituser#gitserver:~/repo.git$ git gui
You need an Xserver running on your local machine, in order to use XForwarding. While this is not a problem on Linux (or OS X), it gets complicated for Win32. There are tutorials on the web for setting up and using Xservers under Win32 (e.g., Xming).
First, when it comes to diff, you can simply git fetch your repo, and do the diff locally (with git gui), since you have the all history.
Second, if you have ssh access to the server, you don't need to actually open an ssh session.
A simple git command git#gitserver:/path/to/git/project.git is enough (repalce "command" with clone/push/pull/fetch)
That means the fetch is easy.
See Git on the Server - Setting Up the Server for an ssh setup, at least for Linux or Mac.
For Windows, you have alternative ssh server you can consider, like copssh-free-edition.
But now our team is having this issue, and I am the only person in charge for the GIT. That's why I looks for help how to solve this
Then you would need to ssh to the server, git add and git commit there in the repo, then go back to your local workstation, clone or fetch, and do the diff there. –

how to create a virtual copy of git repo on a test server

I am fairly new to Git. I have worked locally, but today i need to setup a remote machine with the git. I have no idea how.
Basically my setup is like this.
I have a windows machine which has a vmware player installed, which is used to connect to the dev ubuntu linux machine where out Git repo is situated. I putty to the dev machine and do all the operation related to git with username common to all the developers username : dev
Now there is a new rollup that is created in the dev git repo which is required to be deployed on our ubuntu linux test server. I have my account in test server. username:ash.
What are the steps that should be followed to setup this. I have some time back had a discussion with one of my colleague who had shared about using SSH key. As he is the only contact person who is not available, I have no info how to proceed. I have created the SSH key.
login to the machine as "ash".
ash#gitserver:~$
create a new directory that will contain the git-repository
ash#gitserver:~$ mkdir rollout.git
change into the directory
ash#gitserver:~$ cd rollout.git
initialize the git repository
ash#gitserver:~/rollout.git$ git init --bare
go back to your dev machine and clone the newly created repository or add it to the "remote"s of an existing git repo. use "ssh://ash#gitserver/~/rollout.git" as the remote-url.
[update for cloning]: make sure that there is not already a "rollout" directory in the directory where you want to clone to. for simplicity, create an empty directory "foo/" and try to clone into that directory. you can then move the cloned repository to wherever you want to.
push changes to the new repository.......done!
the use of ssh-keys will make authentication simpler and/or more secure but is in no ways necessary (or related) to setting up the git repository.

git for use on local machine only, with no cloning to/from remote machines?

On a CentOS Linux machine, developers have user accounts. They need to be able to use git on the local machine while logged in via ssh, but is there a way to prevent them from cloning their repositories to other machines?
No. If a user can ssh to a machine and they have read permissions on a repository, they can copy the repository (using rsync or scp), and that is all that is necessary to clone a git repository.
Technically, no. You could probably remove git-upload-pack from the system which would make this harder by making git clone stop working, but a simple scp of the entire directory would still be sufficient.
ensure other machines are not writable / accessible, but other than that no.

Copying files from svn repository

I wanna copy files and folders from my svn repository on server, but I dont want to install svn client, can I do it without svn client?
PS server - linux (CentOS 5.5), svnadmin version 1.4.2 (r22196)compiled Aug 10 2009, 17:54:46.
UPD: files are already exported to server: I want to import files from svn repository to directory, where web-server runs. For example: svn repository located at /var/svn/repos, I wanna dump repository to /var/www, but in /var/svn/repos no files I needed.
PSS sorry for my bad english =\
The Subversion repository isn't in a readable format that you can peruse like you could with CVS. To read the files in the repository you need someone with a client somewhere.
If your Subversion repository uses Apache httpd for its server, you can use wget or curl to pull off the last revision on a specific directory since as an added bonus, the Subversion Apache httpd modules allow you to see the latest version.
$ wget http://svn/repos/foo/trunk/myfile.java
The other option is to use a Subversion repository browser like (ViewVC)[http://www.viewvc.org/] or Sventon. These will allow you to browse the entire repository (including older revisions) without having to install the Subversion client on the local machine. I like Sventon because it doesn't have to run from the Subversion repository server.
If you're on Centos 5.5, you should already have the Subversion command line client installed on your system. In that case, if you don't want the .svn directories, use the svn export command instead of svn checkout.
Or, setup your web server to ignore the .svn directories. That way, you can do an svn update and update the files on your web server without having to redownload everything.
Well, if you have physical access to the server you could use the Subversion client on that box to export files/folders and then copy them from the server to the client machine. If you're trying to do this purely from the client, the only way I can think of would be to manually download the file(s) from the web client but this will only work if you're using Apache as your Subversion server.
Unless the server has an HTTP interface (is the repository URL prefixed with http://? Just open it up in a web browser), no.
It might be simplest to export the files you want on the server (svn export file://repo/path/to/directory), then copy them to the client using http or scp or something.

Is there an ftp plugin for gedit that will let me work locally?

I'm trying to switch from a windows environment to Linux. I'm primarily PHP developer, but I do know quite a bit about other languages such as CSS, XHTML and Javascript. I need a way of editing my files locally because I work in a git repository and need to commit my saves. On windows I used Aptana and PDT. I'd save my files, upload via Aptana, then commit my work with git.
I need to get a work flow going on my Linux machine now. If you know a better way to do this let me know, however my real question is, is there a plugin that allows gedit to upload files instead of working remotely?
git was designed for distributed development and works well as a mechanism for deploying code to a web server.
On your Linux PC, git clone your git repository url. Edit and commit locally and then git push the changes to the git repository. Then, if you have shell access on the server, use git pull to copy the changes to your server.
To ftp sync, you could set up a branch, ftpbranch, that corresponds to what is on the server, and then each time you want to sync ftpbranch with master:
filestoput=`git diff --name-only master ftpbranch`
Now upload the files:
for f in $filestoput; do curl --ftp-create-dirs -T $f ftp://serverurl
Now update ftpbranch indicating these files have been copied to the server:
git checkout ftpbranch; git merge master; git checkout master
When using linux, you can mount the ftp server to a local folder, then opening and save file from that folder will automatically download and upload the file to ftp server.
If you use ubuntu, just click on Places > Connect To Server.... Choose FTP in Service Type dropdown, fill in the required info, then don't forget to bookmark it.
After this, you can open the file directly in any text editor, not just gedit. I would recoment geany for serious programming editor, because it have a lot of neat feature, almost same with Notepad++ in Windows.
But, since you already using git, why not just use git push to get the update and git pull to upload the update? I have long since uploading manually to my server. Git do all the work for me, synchronizing it between servers. Any particular reason why you still need ftp?

Resources