I was looking to update my local repository using GitLab UI. Is this possible without using the command line or any other client application such as GitHUB desktop.
Thanks
GitLab UI represents first your remote repos, as hosting by the remote Git repositories hosting servers.
It can show you the git command to execute in order to clone your Git repository, but you would still need to use that URL in a local tool or CLI, like git clone /url/gitlab/repo.
Related
As the GitHub linking is no longer working due to security issues, my app is still on GitHub and I want to put it on Heroku how do I do this easily?
As the security notification says, you can still deploy via git push.
Assuming you have a local copy of your repository¹ and you would normally do something like git push origin main to deploy to GitHub:
cd to your project directory
Check your remotes:
git remote -v
Do you see a Heroku remote?
If so, make note of its name and go to the next step.
Otherwise, add one:
heroku git:remote -a YOUR_APP_NAME
Now, push directly to the Heroku remote. Assuming it is called heroku:
git push heroku main
You'll probably also want to push to GitHub to ensure the code for your latest release is synced.
I believe this is the simplest option if you're migrating from GitHub integration, but the documentation also lists other options:
Docker-based deployments
Using dpl
Via Git hook
Via Terraform
¹If, for whatever reason, you don't have a local copy of your repository, git clone it from GitHub and then proceed as above.
I have the followings.
Apache server hosted on centos
GitHub (GitHub Actions)
An web app hosted on the local apache server.
Every time I make a change to a local branch and push to remote master branch in GitHub, I have to ssh into the apache server and run git pull origin master. What is the best way and how to set up an automatic pull/deployment on the local server so that it will listen and pull the change automatically?
I have read about GitHub Actions self-hosted runner and ssh solution. but I am not sure how to achieve this in the most efficient way.
You can use GitHub actions to do this by specifically using the action SFTP-Deploy which essentially copies your code from your GitHub repo and places it in your apache server directory.
Trying to deploy internal development from GitHub to a Centos 7 webserver, running into 2 issues.
Firstly, I'm using PHP and need to deploy the class files to a folder that is not /var/www/html/, where I have cloned the repository to using
cd /var/www/
gh repo clone linkto/repo html (this may be the wrong thing to do).
Secondly, Prompting me to think that I've done the first part wrong, when trying to use gh repo sync linkto/repo i get the error can't determine source repository for GitUser/home because repository is not fork leading me to believe that instead of cloning I need to fork it. My intention here is that no code would ever be changed on the server-side just updated on GitHub then push to the server. Am I trying to do too much with GitHub? or am I trying to do it wrong?
EDIT:
doing cd /var/www/html/ gh repo fork gh repo sync and setting a remote back to the origin has solved the second issue
Thanks,
In
cd /var/www/html/
Running once to setup:
gh repo fork with a remote set to the origin
Each time to update:
gh repo sync setting the base repository each time to update
Then using
https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
a server-side post-receive hook to move the classes directory to the desired location
Is it possible to create a new VSTS Git remote repository from a Git client?
Right now, I have to go to visualstudio.com first to create the new repository before adding and pushing it from PC git, using the url created in VSTS.
I tried the following:
git remote add brandnew xx.visualstudio.com/PROJECT/_git/qqq
git push brandnew --all
where I am the owner of xx.visualstudio.com and PROJECT is an existing project, but qqq does not exist.
The above gives me:
remote: TF401019: The Git repository with name or identifier qqq does not exist or you do not have permissions for the operation you are attempting.
fatal: repository 'https://xx.visualstudio.com/PROJECT/_git/qqq/' not found
Yes, it's possible.
Even you can not create a VSTS git repo by git command line by default, but you can achieve it via git hooks.
And for the reason why you can create and publish new VSTS git repo via VS, it that VS will create the new VSTS git repo by API not by git commands.
So if you want achieve this feature in git command line, you can use pre-push hook for assistance. Functions need to achieve in pre-push hook as below:
Detect if the remote repo https://xx.visualstudio.com/PROJECT/_git/qqq exist or not.
If the repo is not exist in VSTS, then create by REST API.
I've got private repo which uses Cert auth for https connection. This is why I can't use standard getting
But I can clone repo using SSH. Is there any way to do it in VSTS?
No, it is not supported in VSTS, you can follow up this uservoice: fetch source from Git via SSH in Visual Studio Team Services.
You may get the source by calling git clone ssh://xxx command through command line task during the build.