I am using gitlab . I want to write a .bat file which contains all the steps so that I can automate all the process , which are as follows:
The 3rd point that is git clone https.... is not working in gitBash anymore. I tried using git clone SSH ... and it is working which asked for the passphrase and after logging in it was about to clone the repo. As I want to automate the process by providing the login credentials by-default , how can it be achieved using SSH. Thank you.
username and password. We can supply the username and password along with the git clone command in the remote repository url itself. The syntax of the git clone command with the http protocol is, git clone http[s]://host. xz[:port]/path/to/repo.
Clone the Repo If you want to clone it to a specific folder, just insert the folder address at the end like so: git clone https://<token>@github.com/<username>/<repository.git> <folder> , where <folder> is, you guessed it, the folder to clone it to! You can of course use . , .. , ~ , etc.
Adding username before gitlab worked for me. It will ask password afterwards.
git clone https://[email protected]/project.git
While generating keys I did give a passphrase.
Simplest solution would be to generate key without passphrase and use it.
Git clone over https should work but url from your example looks wrong. Go to your project page, choose Clone -> HTTPS
url which should look like
https://gitlab.com/<username or groupname>/<projectname>.git
Let's say it is your user's private project and your user would be Julie
, then url with credentials would be
https://user:[email protected]/julie/board.git
Test url manually before you start writing your script.
So going to your script example don't init anything just do for https clone:
git clone https://user:[email protected]/julie/board.git
cd board
git status
or if you create ssh key without passphrase and set it on GitLab:
git clone [email protected]:gitlab.com/julie/board.git
cd board
git status
You will need to use access token. Gitlab doesn't allow to use password directly.
git clone https://<username>:<token>@gitlab.com/group/project.git
To create a Gitlab access token:
Edit profile
Access Tokens
Token name
and Expiration date
(if any)read_repository
checkboxCreate personal access token
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With