Pipeline creation on AWS with GitHub repository - github

When we create a pipeline on AWS we can provide a Github repo, let's say the repo name is: "RepoName/exampleProject" and in this repo, we have many folders. So can we provide a subfolder from this repo like "RepoName/exampleProject/subFolder" to repo section in add source stage in AWS?
Since we could have two Folders in this repo like Laravel for the backend and a separate project Vue Js for the frontend.

No. Not for GitHub or AWS CodeCommit. Basically, its a no for any git provider.
What your are providing here is a / and the you provide branch.
These details are required to git clone the source code which will be transition to next stage. When you do a git clone, you clone the entire repository and not any specific folder.
If your source files are on S3, it will be a different case. S3 is not a git based version control. You can download specific folder from S3.

Related

Two names for the same github repo

Is it possible to create an alias or redirect to a GitHub repo?
For instance, is have the repo org/my-repo, and i want that when i clone the repo org/my-repo-2 (that does not exist), the repo org/my-repo will actually be cloned.
I need it to support a CI/CD process for two separate services that use the same repo, but each one of should be deployed with a different configuration. I want the repo alias to prevent adding conditions to my code.

Push large file to Azure repo but ignore in GitHub

I have a project linked to both a GitHub and Azure repo. This project has a saved tensorflow model on my workspace which my project manager is requesting I add to the Azure repo. I cannot add this to the GitHub repo as the file sizes are too large.
I have tried committing the files and then pushing to the Azure repo. Then uncommiting the file and pushing to the GitHub repo, but the next time I ran a push to the Azure repo, these files were lost as I had now uncommited them in the tree.
Is there a way to push these files to the Azure repo only, but ignore them for the GitHub repo?

Update a GitHub repository without cloning

Here's the situation, we are currently working on a project and lately we decided to upload it on GitHub. Now I made my changes and I want to push the changes onto the repository.
As far as I read, in order to make changes you need to clone the repository but that will download all files from the repository and I already have all of the source files.
I'm using GitHub desktop and I can't find any option to clone without downloading and update or create branches from my existing files. Creating a local one is an option but it needs to be uploaded as a separate repository instead of linking it to a current one.
Is there any way to push updates, create branches to the repository from my local project to an existing repository?
Your local project should already be a git repo, if you uploaded it to GitHub.
But in case it is not, switch to command-line, and do inside the root folder of your project (which should shows the same files as your remote repo):
git init .
git remote add origin https://github.com/<user>/<project>
git fetch
The fetch part will download the repo but leave your files alone.
(But do a backup still, just to be safe)
git branch master origin/master
git reset master
From there, your GitHub Desktop should show you any diff between your files and what was fetched from the repo.

Synch NetSuite SuiteScript Files with Git Repo

We're trying to use Git source control for our NetSuite SuiteScript. How can I synch my Eclipse SuiteScript workspace files with my local git repo if the local repo already contains the files (meaning "Share Project" won't work)?
I've already setup a Git Repo for our NetSuite SuiteScript library. The initial setup was simple because I pulled down our file cabinet using the SuiteCloud IDE (Eclipse/NetSuite bundle), added an existing local git repo, and used the Eclipse Team > Share Project feature to push the SuiteScript files to the repo. However, that method only works the first time through.
Our other developers aren't able to use the Share Project feature to synch the projects with the Repo since the files already exist in both locations. The challenge is that the files need to be pulled directly from NetSuite first in order to have the necessary indexes for the File Cabinet.
I think you should be able to pull files from file cabinet, do git init , commit files to git repo, and then delete the project from workspace. This would ensure the files exists in netsuite and git repo both.
Now, you can take a similar approach as in the case where files existed in both NetSuite and git repo, by creating new project and pulling up the files again from NetSuite and adding git repo info.
I found a way to do this.
Clone your remote repo (can use init too but easier with clone IMO)
Delete all the files in your repo
Pull all the files into Eclipse from NetSuite.
Use Team > Share Project to synch with your repo
Use fetch to reset to the remote repo
git fetch
git reset --hard origin/master
After this you're all set.

Creating an official github mirror

How do I create a github mirror for an external git repository, such that it appears as "real mirror", e.g., as in https://github.com/mirrors?
So far, I set up a mirror using:
cd /path/to/bare/repository
git remote add --mirror github git#github.com:user/repo.git
and configure the post receive hook to do a git push --quiet github. This way, however, github does not recognize the mirror.
Any ideas how to do it the github way, such that "Mirrorred from" appears underneath the repostiory name?
Based on communicating with GitHub's support team, I found that GitHub currently offers no direct mechanism for a user to mirror repositories in this fashion.
However, one can ask GitHub to install this service for repositories which are part of an organization. GitHub then configures an existing repository as such a mirror and pulls from it in an interval that is a function of the number of overall mirrors they have.
EDIT: as Stuart points out, GitHub no longer accepts requests for mirroring arbitrary repositories. The only remaining option is the solution I posted in my question, i.e., creating a post-receive hook to automatically push to your GitHub repository.
Judging by the current content of https://github.com/mirrors, it would appear GitHub no longer does "official mirrors", as most projects that want their code mirrored on GitHub today just makea an organization for it, such as Git itself.
There is also a feature request at: https://github.com/isaacs/github/issues/415
According to Importing a Git:
For purposes of demonstration, we'll use:
An external account named extuser
A GitHub personal user account named ghuser
A GitHub repository named repo.git
The command line:
# Makes a bare clone of the external repository in a local directory
$ git clone --bare https://githost.org/extuser/repo.git
# Pushes the mirror to the new GitHub repository
$ cd *repo.git*
$ git push --mirror https://github.com/ghuser/repo.git
# Remove the temporary local repository.
$ cd ..
$ rm -rf repo.git
I have used a tool called github-backup with moderate success to, if not mirror, at least make a full backup (including issues and other metadata) of a Github user or organization. To quote the README file:
Each time you run github-backup, it will find any new forks on GitHub. It will add remotes to your repository for the forks, using names like github_torvalds_subsurface. It will fetch from every fork.
It downloads metadata from each fork. This is stored into a branch named "github". Each fork gets a directory in there, like torvalds_subsurface. Inside the directory there will be some files, like torvalds_subsurface/watchers. There may be further directories, like for comments: torvalds_subsurface/comments/1.
You can follow the commits to the github branch to see what information changed on GitHub over time.
The format of the files in the github branch is currently Haskell serialized data types. This is plain text, and readable, if you squint.
Limitations include:
no private repository support
no "social" stuff like stars, followers, etc
notes to lines of commits are not supported (yet?)
issue labels