I have github setup as a VCS repository in Artifactory. When using the downloadBrach API through Artifactory (similar to downloading files via git clone), the download appears to include everything except the dot hidden files (.gitignore is an example).
Is there a way to include all files (including the dot hidden files) when downloading a branch from an Artifactory VCS repository?
This is what I've tried:
curl -XGET "https://artifactory.domainname.com/artifactory/api/vcs/downloadBranch/github-remote-vcs/jquery/jquery/master" -o jqueryMaster.tar.gz
This results in a gzipped tarball that contains all files in the repo, except for the dot hidden files but I need all files in the repo.
Update #1
Slight correction - the dot hidden files are getting downloaded with the exception of the .git subdirectory containing information about the Repo itself. Does anyone know if there is a way to get the .git directory as well as the Repo metadata included?
Does anyone know if there is a way to get the .git directory as well as the Repo metadata included?
No: The downloadBranch is for downloading a tarball (tar.gz/zip, default tar.gz) of a complete branch.
It is an archive, not a full repo history.
Exposing a VCS history through Artifactory API is for downloading archives only, not a full repo.
List all tags
List all branches
Download a specific tag
Download a file within a tag
Download a specific branch
Download a file within a branch
Download a release
Related
How to config the _data folder to another git repository? The whole folder is clone from github and want to continue due to easy update. But the _data folder need to sync with another data repository. How can I config it?
Actually just one yaml file : _data/authorlist.yaml
What to put into package.js if want a script to sync the yaml file with github?
Thank you.
You can use Git submodules to keep a shared repository of data files that you can use in multiple projects. This will allow you to keep a reference to the data repository in your projects, and pull updates to this repository with a single command. The great thing is that submodules are a built-in feature of Git, so it's independent of any NPM scripts, environments (like a bash script would be) or frameworks. See the link above for documentation on how to set up and work with submodules.
I decided to backup all my github data and found this: https://help.github.com/en/github/understanding-how-github-uses-and-protects-your-data/requesting-an-archive-of-your-personal-accounts-data
I managed to get the .tar.gz file and it seems to contain all my repositories but there is no source code in there. Judging by the size, it looks like some kind of archive in objects/pack/*.pack
Is there any way to access original source code?
it looks like some kind of archive in objects/pack/*.pack
According to Download a user migration archive:
The archive will also contain an attachments directory that includes all attachment files uploaded to GitHub.com and a repositories directory that contains the repository's Git data.
Those might be bare repositories or bundles.
Once uncompressed, try and git clone one of those folders (to a new empty folder)
The OP johnymachine confirms in the comments:
git clone .\repositories\username\repository.git\ .\repository\
Meaning repository.git is a bare repo (Git database only, no files checked out)
see the Git Ignore option in the below image.What I have to choose, I am creating an ionic-framework repository.
https://i.stack.imgur.com/pBvkd.png
.gitignore is a file which, Git uses to determine which files and directories to ignore, before you make a commit. These files/directories will not be pushed into the repository.
If you have any files or directories that don't need to be pushed into the repository, then you can include them. (a simple example : log files)
If there is no ionic option, you can ignore it, and create it locally on your repo, then push it back to your GitHub repo.
To create it, see https://www.gitignore.io/api/ionic3
It does generate an Ionic .gitignore for you.
There is a GitHub repository that I would like to download as a zip file. However, some of the code I want to download is located in separate repositories and only a link to those repositories are located in the main repository, not the actual code. If I want a zip file containing the whole codebase, do I need to download the separate repositories and assemble it, or is there a way to do it?
Not directly from GitHub: the tarball or archive representing a repo does not include its submodules, assuming the repo has a .gitmodules file.
Only a git clone --recursive (maybe with --depth=1) would get you a complete content.
Note: if the repo does not have a .gitmodules file, those references are just gitlinks to other repo SHA1, without their URL, in which case even a regular clone would not get their content.
If I want a zip file containing the whole codebase, do I need to download the separate repositories and assemble it?
Yes, ... except you might end up with the wrong content: the main parent repo does reference other repos specific SHA1, so you need to make sure to query an archive for the right reference.
I need to delete my "uploads" folder from the repository with all its history because it contains only junk testing data.
Please help.
You'll want to use the convert extension that ships with mercurial. Since you want to scrub a directory from the history you'll have to completely filter you're existing repository, CONVERTing it into a new one.
Assume the following made up structure of your repo:
/
src
doc
images
upload
Create a simple text file with the following content
exclude upload
You can do more with this file but keep it simple to get to your goal. The path to be excluded is relative to the repository root
Now run mercurial convert
hg convert --filemap path/to/the/textfile old-repo new-repo
Change to the directory of the new repo. Notice that mercurial created a bare/null rev repo (no content but the .hg directory). Run the following to update to your latest changset. Notice the upload directory is gone!
cd path/to/new/repo
hg update
WARNING: I do not know how this handles named branches or tags. You're on your own. At least you're not modifying the original repo. Make as many copies as you need to get it right.