Gitlab Runner to push files generated on the fly back to repo - gitlab

I have a repository in GitLab, this repo has some files along with .gitlab-ci.yml file. On pushing/submitting changes and with the help of .gitlab-ci.yml file, code in this repository generates new files on the fly. Is there any way to push the files that got generated on the fly back to the repository upon the completion of the pipeline job?
Thanks in advance.

yes of course you can use git commands to add your files, commit and push them

Related

Uploading a directory full of files in GitLab

I can't find this topic in the documentation. I'm trying to upload a folder of files to GitLab - i.e. the file containing the entire webpage, (HTML files, assets, JS, etc.) In other words, I want to upload my entire repo to GitLab.
But, I only see the option to upload a single file at a time:
How can I upload a folder of files?
Folder upload is not supported as far as I know.
You could clone the project locally (blue button) creating a local repository and move/cope the folder to your local git-repository.
Then you just git add, git commit and git push everything.
Step by step:
Stage everything in git repo:
git add -A The parameter "-A" stands for "all", it will add every file and folder (apart for empty folders) that are in the repository to the commit.
git commit -m 'your message' will commit all your files/changes locally.
git push will upload your commits so that you can see them on your GitLab page.

Can I upload a whole folder in gitlab repo via API?

Gitlab API Commit
This I know but can't find an API to upload a whole folder containing various js, CSS and HTML files into gitlab repo.
Does this help? How do I add files and folders into GitHub repos?
git add <folder>/*
git commit -m "<Message>"
git push
I often use git add -A to add all modified files. But should use git status before and after adding to make sure you see which files have been added before committing.

How do I keep a git clone updated?

I am developing a project on my laptop that is to be implemented on my VPS. I am continually making updates on my laptop and pushing them to my git repo, but I am in the dark on how I should keep the clone I made on my server, updated.
When I try to run git clone <url> in my directory, it tells me 'file already exists!' or something along those lines. Do I just delete the entire folder and reclone the repo like that? Or is there a way, other than initiating the directory as git, and creating an upstream, that I can reclone without having to delete everything first?
How do I keep a git clone updated?
I generally clone git project.
git clone git#source.golabs.io:mobile/project-name.git
and after that I start developing my feature by creating new branch branch.
so for up to date with remote project you need to checkout to master branch. and just do
git pull and sync your project using ./gradlew clean build
If your project have submodules- you need to do
git submodule update --init --remote --recursive
try to use git pull. it will automaticly analyze the difference .And try to fix it
Instead of having to go to your server and pulling, you could setup a listener in order to do the pull for you.
For instance, if you are ushing to GitHub or BitBucket or GitLab, you can setup a webhook (GitHub webhook, BitBucket webhook, GitLab webhook), and a local listener in order detect the push, and triggger a git -C /path/to/your/repo pull.

How to delete files from master of stash

Hi anybody could help me in deleting files from the master of stash?
I am new to stash and git commands and while commiting the initial version to stash all the files from the project folder got committed to the repository but i want that files to be placed inside a folder wheras now it is all scattered over there. Please do help me in deleting those files and again commit the files inside the folder.Is this possible or do I need to delete the repsitory itself?
A stash is a patch and is local.
You could save a stash to a file with git stash show -p > stash1.patch and remove it with git stash drop (apply and remove it with git stash pop), otherwise follow the git-stash documentation and tutorial: https://git-scm.com/book/en/v1/Git-Tools-Stashing; there is almost everything you need to know in the manual...

Git - Syncing a Github repo with a local one?

First off, forgive me if this is a duplicate question. I don't know anything but the basic terminology, and it's difficult to find an answer just using laymen's terms.
I made a project, and I made a repository on Github. I've been able to work with that and upload stuff to it for some time, on Windows. The Github Windows application is nice, but I wish there was a GUI for the Linux git.
I want to be able to download the source for this project, and be able to edit it on my Linux machine, and be able to do git commit -m 'durrhurr' and have it upload it to the master repository.
Forgive me if you've already done most of this:
The first step is to set up your ssh keys if you are trying to go through ssh, if you are going through https you can skip this step. Detailed instructions are provided at https://help.github.com/articles/generating-ssh-keys
The next step is to make a local clone of the repository. Using the command line it will be git clone <url> The url you should be able to find on your github page.
After that you should be able to commit and push over the command line using git commit -am "commit message" and git push
You can use SmartGit for a GUI for git on Linux: http://www.syntevo.com/smartgit/index.html
But learning git first on the command line is generally a good idea:
Below are some basic examples assuming you are only working from the master branch:
Example for starting a local repo based on what you have from github:
git clone https://github.com/sampson-chen/sack.git
To see the status of the repo, do:
git status
Example for syncing your local repo to more recent changes on github:
git pull
Example for adding new or modified files to a "stage" for commit
git add /path/file1 /path/file2
Think of the stage as the files that you explicitly tell git to keep track of for revision control. git will see the all the files in the repo (and changes to tracked files), but it will only do work on the files that you add to a stage to be committed.
Example for committing the files in your "stage"
git commit
Example for pushing your local repo (whatever you have committed to your local repo) to github
git push
What you need to do is clone your git repository. From terminal cd to the directory you want the project in and do
git clone https://github.com/[username]/[repository].git
Remember not to use sudo as you will mess up the remote permissions.
You then need to commit any changes locally, i.e your git commit -m and then you can do.
git push
This will update the remote repository.
Lastly if you need to update your local project cd to the required directory and then:
git pull
To start working on the project in linux, clone the repo to linux machine. Add the ssh public key to github. Add your username and email to git-config.
For GUI you can use gitg.
PS : Get used to git cli, It is worth to spend time on it.

Resources