Download GitHub repo as zip on Windows, including CRLF - windows

Because I use core.autocrlf on Windows, my linefeeds that I commit and push to GitHub get normalised from CRLF -> LF which is good. When I clone on Windows they get converted back LF -> CRLF. However I want to download my repo as zip on a Windows machine without git installed. Now the linefeeds are incorrect for Windows.
Is there a way to download files from GitHub without git installed but still adding the CRLF back to the files?

When you download an archive from GitHub, it's essentially generated with git archive. That means what you get in the archive is what's in the repository, which means that Git doesn't perform CRLF translation. GitHub doesn't provide an option to adjust this because Git doesn't provide such an option.
What you're doing using LF in the repository and CRLF in the working tree (if you want that) is the right way to work with Git, and you should keep doing that.
If you want to do a release with a zip file that contains files with line endings different than what's in the repo or with additional files that aren't included in the repo, then create a release on GitHub and upload such an archive as a release asset. Then you can include whatever line endings you want or whatever else you want in the archive and have it available without the repository. Many common projects do exactly this.

Related

Unicode filenames not preserved on windows when downloading zip of gitlab repo

I have a Gitlab repo where one of my files is named "инит.ћ". I created the repo on a Linux machine, and now I'm trying to download it from the Gitlab webpage onto a Windows machine.
This results in that specific filename getting mojibake'd into "-+-+-+-é.-¢".
When I use git to clone the repo, this doesn't happen, and the filename is preserved. And when I download the zip file on Linux, the filename is still preserved.
Is there any way to remedy this. I'm not even slightly familiar with how windows deals with filenames. So I don't think I can give much more useful info than that.

XCode SVN commit doesn't show changed files after relocate

The SVN repository I was using for XCode was relocated to another server and I was require to perform the relocate inside XCode. The command I used for relocating was:
svn relocate oldLocation newLocation
The command itself worked great. The problem I'm encountering is that now whenever I click on Source Control -> Commit, the GUI that appears doesn't show any of the modified files.
If I use the command line and use either svn stat and svn commit, I can perform the necessary functions. While the command line tools work, it does add a lot of time when trying to commit any modified files. Is there another setting within XCode that I need to change in order to allow myself to commit using the GUI?

Git editing my files

I just installed Git on my PC (Windows 8.1 Pro) and cloned my repository (containing about 5000 .c and .h files) from Github via git clone. Now if I say git status, it shows five modified files (the changes show some words replaced by others).
The problem is that I can't commit this; if I try git add . in my project's root directory, nothing happens. Running git status after still lists five files as modified. Running git commit doesn't remedy the situation.
I am running on the newest version of git on windows
How can I get this to work?
I found the answer..
I had to install cygwin with integrated git package and clone the repository with cygwin, then commit and work with cygwin. I can use windows editors to edit the files!

Non-project files in Xcode git repository

This is an organizational question for iOS and OSX developers.
When you are using the automatically generated git repository for an Xcode project, how do you add/commit your non-project files such as PSDs or other third-party tool files that are the "source" for the image and audio resources? Do you add them using the git command line, or do you prefer to maintain a separate repo for these files?
I used to use the command line, but now use a GUI, to add them where they make sense in git, for example a "Source Images" folder for psd files, but I do not check in any generated files (i.e. PNG files generated from the PSDs.)
My git GUI app du-jour is Source Tree to add the files.
I also add a custom .gitignore to all of my repos and check it in as well, but that is a different discussion.
I feel that having separate repos makes it easier to make mistakes and lose important changes, since you do not need to cd to a different repo and run the git commands there.

How can I use Git locally in an SVN+Visual Studio environment

I've been playing around with git at home and I really like the idea of local commits. Being able to commit smaller changes without spreading my potentially broken code to everyone is nice, as well as being able to revert smaller changes because of the more frequent commits.
I've been reading about the git-svn command, but I'm not sure I entirely understand how it works. We work on Visual Studio 2008 projects, and run VisualSVN which handles file renames, moves, and all that for us from within the IDE.
What I want to know is: Is it possible for me to commit to a local git repository but also commit to the remote SVN repository as well? I'd like to keep VisualSVN change tracking and committing from within the IDE, but also be able to use git to temporarily store changes. Are they likely to get in each other's way?
It works beautifully. go for it. Just don't check your .git folder into svn.
edit: erm, when I do it though, I don't bother with git-svn. I just treat the local working directory for svn as any other directory, and I tend not to care much about the previous SVN history.
I've used git-svn to keep "updating" from the remote repository, but haven't used it to commit to an svn repository, so I can't help you about that part.
What you do is simple, with all settings on default:
>git svn init <url......>
>git svn fetch
When you do that, it fetches it to a "remote" branch called "git-svn".
To merge it with your current branch:
>git merge git-svn
You may run into some issues if you're using git-svn after the fact. What I mean by that is: you already have checkout the project using svn, then you also created a git repository in your local working svn directory. Then you use git-svn on top of that.
Two issues I had to deal with:
Line endings. svn might convert line endings to windows, while git-svn will preserve them to unix style. So you might get tons of conflicts due to the line ending differences.
So to be sure, use a tool to convert line endings on all files to unix (or windows, depending on what line ending is used in the svn repo).
svn keyword expansion. e.g. $Id$
git-svn will not expand these keywords, while svn will. So you'll have conflicts there as well. Again, use a tool (or write a script) that converts all instances of $Id .......crap.....$ to just $Id$`

Resources