GitHub online editing
-
I had a look in the doc areas, but couldn't see anything, so am posting this.
On GitHub, I am just doing small-medium edits to a few files. So I am just using the web interface and editing online in my own fork of each repo. Github stores the fork online, nothing is installed on a local computer of mine.
I can do edits online fine, commit them, make pull-requests and after review those get accepted (hopefully) into the main repos.
To download a file from my repo, so far I can only do it by downloading a zip or tar of all the code in my fork (or the main repo) then unpacking that locally. For quick testing I am looking for a button that lets me download an individual file that I am viewing online, or have just edited.
In the reverse, if I have got something working on my test pfSense system, I want to be able to upload an individual file into my online Github repo. Then it can show me the diffs against the master repo, and I can decide to edit some more or commit. At the moment, I can only edit online, so if I have made changes offline I have to do the same edits in the online Github editor. That is a recipe for error.
Maybe this functionality is not available online? Maybe I have to install some Github software locally?
After all that, the question is:- How to I download and upload individual files to/from my online fork of the Github repos?
-
You can download fine but I'm not aware of a way to upload the same way. To download you browse to the file in the repo just like you were going to edit it but then click "raw" to get the raw file, which you can then save.
I suppose if you edit the file then paste in your locally edited copy to the edit box it may sort of work, but that could be a fairly error-prone process
You can use some git software like tortoisegit or msysgit+gitbash (I use both) to work with git on windows.
-
I didn't find any way to upload files to github using the online webinterface.
If I do a change on an existing file I copy the content of the RAW file to my editor "Notepadd++ for windows" and edit the file. If everything is ok I copy and paste the complete file from my machine and paste it online. This way I didn't have any problems with copy and paste.
A tutorial for git is here:
http://help.github.com/fork-a-repo/I used this package on pfsense itself - if I remeber correct:
pkg_add -r ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/All/git-1.7.9.4.tbz
-
I am using Notepad++ already - http://notepad-plus-plus.org/
Nachtfalke - your suggestion works well. For the benefit of others, the process is:- Getting the file
- navigate to the file in my fork in Github
- click "Raw" - the text of the file appears in the browser tab
- crtl-A ctrl-C - select and copy all the text
- Open a new file in Notepad++
- ctrl-V to paste in the text
- make edits, save the file locally, copy to pfSense box and test…
- Sending the changes back
- In Notepad++ ctrl-A, ctrl-C to copy the whole file.
- navigate to the file in my fork in Github
- click "Edit this file"
- in the editor window, crtl-A, ctrl-V to replace all the text with the version from Notepad++
- click "Preview" to see the diffs
- when all looks OK, enter a commit message and click "Commit Changes"
This process will prevent dumb syntax errors between the tested version and Github commit version. Specially if the diff preview is checked properly. This seems like a good way to work for those who are only changing a few files here and there. Hopefully this post will be of use to others getting started with contributing to development.
-
Very good explanation. I couldn't say it better :-)