Issues with sharing repository between linux and windows - linux

I am sharing my repository between my linux and windows machine and pushed some permission changes on my linux machine.
Now my windows machine says I'm up-to-date when doing this:
git fetch -all
git reset --hard origin/master
git pull
yet when I attempt to do the following:
git checkout dev
It suddenly tells me I have local changes, which just so happen to be the same files of which I modified the permissions on my linux machine.
What is the right way of dealing with this? I made those permission changes so I don't have to manually use chmod every time I pull on my linux machine.

Try setting core.fileMode to false on Windows, then the executable bit is ignored for the windows repo.

Related

How to avoid warning 'LF will be replaced by CRLF' in git?

I'm using GitHub Desktop v.2.6.9(x64) for Windows 10, with WSL2 Linux Ubuntu 20.04 LTS. The GitHub Desktop installed in Windows, but git repo and all the code and development happens in Linux partition, by VS Code and extension "Remote - WSL" by Microsoft, both installed in Windows partition. I can see my GitHub repo saved in Linux partition in GitHub Desktop, but when I try to change branch, I'm getting Error window, with the famous Warning "LF will be replaced by CRLF in …" for many files.
I can't change branch in GitHub Desktop, every time I'm trying to do it, the Switch Branch window appears, saying "You have changes on this branch. What would you like to do with them?" and 2 options Leave my changes on current branch, or Bring my changes to new branch. I choose Leave option, but can't actually change the branch - the same Error window with the same Warning appears again. It's very annoying. There is a lot of pages related to fix like this one.
To fix this problem, I try to run in the Ubuntu terminal:
git config --global core.autocrlf true <-doesn't fix the warning when changing branches
git config --global core.autocrlf input <-doesn't fix the warning when changing branches either
git config --global core.autocrlf false <-doesn't fix the warning when changing branches either
I restart my GitHub Desktop after every change and try it, and the result is the same every time.
My guess that as GitHub Desktop is installed for Windows (not for Ubuntu, with xming or other x-server), it uses it local settings, saved somewhere in Windows partition, and ignores whatever changes I do in Linux git config. Is it the case? And how to fix it for this setup (Github Desktop is installed for Windows, and git and repo files - for Linux Ubuntu, with WSL2).
UPD: the partial workaround is to install xserver in windows, connect via putty to local Ubuntu with x11 forwarding allowed, install GitHub Desktop in Linux partition, and use it. In that case there is no Warning 'LF will be replaced by CRLF' problem, when I try to change branch. But WSL2 Ubuntu changes IP address every time it's re-started, which is not very convenient for frequent Putty connection.

How to connect to git repository in a remote Linux machine using Visual Studio 2017?

I have a git repository installed in a remote Linux server, but would like to work on it and sync my changes to the git repository using Visual Studio Community Edition 2017.
Apologies if this is a repeat question; am new to this and have looked at the existing answers on SO but don't seem to have found a direct answer for this.
I have managed to use Team Explorer to connect directly to github, but would prefer to connect to the git repository on the Linux server instead.
Thank you.
Let's say you have a user on the linux machine, with a projects subfolder in your home directory, and under that you have a git project in a folder called myproject.
You should be able to run git clone username#server:projects/myproject at any remote terminal (including windows with git installed), assuming you have an ssh server enabled on the linux server above (you may have to install openssh-server first).

Linking my own Git server with my Windows Eclipse IDE

I'm trying since two days to set up a private Git and link it with my Eclipse IDE.
First of all, I have a Raspberry running Rasbian as a server. SSH is working with SSH keys.
I created a new user to store my Git projects on. Git is installed too.
My dev computer is running Windows 10 and Eclipse Neon.1 with the Git plugin installed on. I have MSysGit installed too.
And here I can't link anything to make it working well together.
First, I didn't find how can I tell to EGit to use a SSH key. So I wanted to use the Git GUi provided by MSysGit but I don't know how to link it with my server.
I'm not here to ask you to setting up for me or even tell me how to do it step by step, I'm just looking for a detailled tutorial or video which can helps me with it. Most of tutorial I rode use Linux as dev OS, or link Eclipse directly on GitHub so I didn't find a situation like mine.
First you need git setting done in eclipse that provide GUI for git commands.
Then to link local server, add you local git server URL to your project remote URL. and it should be able to pull & push commit to your server.
This tutorial should be enough for all you need.
http://www.vogella.com/tutorials/EclipseGit/article.html
http://monkeyhacks.com/post/raspberry-pi-as-private-git-server

Windows git client over ssh for local repository?

I have a set-up where I have a remote git server, a local git/development machine running Linux, and a Windows development machine.
I generally use putty from windows to log into my local linux development machine, which is where my local git repository resides, as well as where I do my compiling, etc.
I'd like to use a (gui) git client on my windows development machine to manage this git repo, particularly for visualizing branches, etc, since my linux machine is mostly headless.
It it possible to control it using a windows git client via SSH, so that I can use windows to manage my local git repository on my linux dev machine? I don't want to have a repo on both my windows and linux dev machines, and I don't want to go through a two-stage push process.
My other option I suppose is to add my linux machine as a network drive under windows and connect that way, but it's awfully slow.
(And if anyone has any recommendations for which windows client is good and can do this, please let me know. I'd like to use SourceTree, but I don't think it's capable of this)
Thanks!

clone mercurial repository to remote machine

is there any way to clone my mercurial repository to a separate machine ? (might be a silly question, but i'm pretty new to mercurial )
i want to clone the whole repository from a CentOS machine to an Ubuntu machine for some testing and i don't want to mess anything up on my working machine
If you have SSH access, can go
tar c '/path/to/your/repository' | ssh username#somemachine 'tar x'
That will get the repository and the current working directory over there.
Of Course, Go to the the Ubuntu Machine, install Mercurial, and clone your repository in the CentOs Machine from the Ubuntu machine.
Now you have a clone repository from the CentOS in another Machine, make your changes in the Ubuntu Machine, if you agreed with the changes, then push the Changes to remote repository(CentOs Machine).

Resources