I was trying to pull only a specific file from the fossil scm but the only reply I got was
Fossil internal error: repository does not exist or is in an unreadable directory: blahblah
the commands I tried to use was
fossil pull "file" -R "http://user#ip/folder/to/fossil"
fossil pull "" -R "http://user#ip/folder/to/fossil/file"
I don't understand the documentation. If I wanted to just download a specific file without opening and cloning the repo, how would I do that?
You can't pull a single file from a fossil server. Pulling retrieves ALL the (new) changes in the remote repository into your local repository. It's the read part of the sync command, and it requires you to have cloned the repository first. (The -R command-line option always indicates a local repository).
But it seems to me that what you want, is simply to download a specific file from the remote repository. To do that, just use your browser to navigate the fossil server's web site (I'm using Fossil's own source code repository as an example):
http://fossil-scm.org/fossil/dir?ci=trunk
http://fossil-scm.org/fossil/tree?ci=trunk
and click on the file you want. On the page displaying the file, there's a Download button which will let you download that version of that specific file.
If the file is not text or HTML, you can just download the file using http, using a so-called documentation URL:
http://<server>/doc/<version>/<path-to-file>
For example, let's say you want to download the trunk version of the file www/concept1.gif from the main Fossil repository. That can be achieved by downloading the following URL:
http://fossil-scm.org/fossil/doc/trunk/www/concept1.gif
That URL is composed as follows:
http://fossil-scm.org/fossil is the repository's location;
/doc/ indicates that you want to access the repository's files directly;
trunk indicates the check-in you want to access. This can also be a check-in identifier (like e319e8e870) or a tag (like pending-review). If you specify a tag or branch name, you'll get the file associated with the last check-in with that tag, respectively in that branch;
/www/concept1.gif is the path within the repository to the file you want to access.
Note that if the file you requested is a wiki, text, or HTML page, fossil will add its header and footer to it.
Related
I have files in repository. I want them to be grouped inside a folder. How can I do this?
It seems that I need to add new file if I want to create a folder.
From how you worded your question, it seems like you're trying to work on github directly from the website.
The usual way github works is:
if you have a repo on github and you want to modify it, first 'clone' the repo into your local computer,
use these instructions https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository
then just change folder structure like you would normally on File Explorer (windows) or Finder (mac),
then follow the commit instructions and 'push' up your changes to github
use these instructions
check status of your recent changes:
git status
add the files that you want to include in the commit
git add nameOfFile
check status and the file you want to include should now be green
git status
use this to send to github
git push
Overall github docs here:
https://learn.microsoft.com/en-us/training/modules/introduction-to-github/
I want to get the copy of code from github from a particular branch into my local machine.
I need to fetch the copy of a particular folder from github from a selected branch but i am unable to do so. I tried achieving through svn command but it enables only the code from master branch.
svn export https://github.com/Tavisca-Saurabh/Angular-Library/trunk/Tavisca-Orxe3-Library/projects/tavisca-orxe3-library/src/lib/tavisca-input
This enables me to get data from master branch but when i try with specific branch it shows error.
Try replacing the URL with "github.com/Tavisca-Saurabh/Angular-Library/branches/Develop/..." instead of "github.com/Tavisca-Saurabh/Angular-Library/tree/Develop/..."
I am able to export the URL you have mentioned.
svn export https://github.com/Tavisca-Saurabh/Angular-Library/branches/Develop/Tavisca-Orxe3-Library/projects/tavisca-orxe3-library/src/lib/tavisca-input
Is there a way to download a single file from a specific branch of Git Remote repository?
Repo_URL:https://test.ghe.com/repo.git
Branch:release
Git relative file path: repo/file01.txt
There are many related threads however in none gives idea about how to use a specific Git remote branch.
Please help.
Thanks.
Kumarjit
To get the raw URL for your file, follow below steps.
1) Open your repo and required branch in github website.
2) Navigate to the folder containing your desired file.
3) On top of the file, you see "Raw" button.
4) Click on that and you see the raw URL in address bar.
5) You can use this URL to download the file, for example using curl.
However, I'm not sure about your use case, but it is always better to use git pull to get the file.
Hope this helps!
I want to learn how to use rawgit.com to serve other applications from github.com.
So we have a usual way to download and install homebrew on osx.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
I can't find the install file on GitHub. Where is it?
The raw.githubusercontent.com domain is used to serve unprocessed versions of files stored in GitHub repositories. If you browse to a file on GitHub and then click the Raw link, that's where you'll go.
The URL in your question references the install file in the master branch of the Homebrew/install repository. The rest of that command just retrieves the file and runs ruby on its contents.
There are two ways of looking at github content, the "raw" way and the "Web page" way.
raw.githubusercontent.com returns the raw content of files stored in github, so they can be downloaded simply to your computer. For example, if the page represents a ruby install script, then you will get a ruby install script that your ruby installation will understand.
If you instead download the file using the github.com link, you will actually be downloading a web page with buttons and comments and which displays your wanted script in the middle -- it's what you want to give to your web browser to get a nice page to look at, but for the computer, it is not a script that can be executed or code that can be compiled, but a web page to be displayed. That web page has a button called Raw that sends you to the corresponding content on raw.githubusercontent.com.
To see the content of raw.githubusercontent.com/${user}/${repo}/${branch}/${path} in the usual github interface:
you replace raw.githubusercontent.com with plain github.com
AND you insert "blob" between the repo name and the branch name.
In this case, the user is "Homebrew", the repo is "install", the branch name is "master" (which is a very common branch name). You insert "blob" between "install" and "master", so
https://raw.githubusercontent.com/Homebrew/install/master/install
becomes
https://github.com/Homebrew/install/blob/master/install
This is the reverse of finding a file on Github and clicking the Raw link.
raw.githubusercontent.com/username/repo-name/branch-name/path
Replace username with the username of the user that created the repo.
Replace repo-name with the name of the repo.
Replace branch-name with the name of the branch.
Replace path with the path to the file.
To reverse to go to GitHub.com:
GitHub.com/username/repo-name/directory-path/blob/branch-name/filename
I am using Github in our Project.
When I am checking in Github to pull data from original master it is displaying all the files but I need the files which are changed by me.
You can use git log to display updated files by author.
See for instance "Can I get git to tell me all the files one user has modified?"
git log --pretty="%H" --author="authorname"
(replace authorname by your own, as you specified it in git config user.name)
After a pull, you can log between master#{1} and master.