Git supports pushing the files to the repo only through tokens.
Here will explain how to generate tokens for Git access.
- Login to your Github Account
2. Access url: https://github.com/settings/tokens
3. Enter: Generate Token
4. Provide some info in Note
5. Select required checkboxes (I selected all checkbox)
6. Click Generate Token
A token will be generated for you.
You have to use the generated token to do git clone.
How to git clone with generated token
For eg:
Username is : johndoe
Generated Token is : ghp_abc123
Repo is : greetings
Then the git repo url will be :
https://johndoe:ghp_abc123@github.com/johndoe/greetings.git
7. Once the token is generated, you can also set it globally in gitconfig
$ git config --global url."https://${username}:${access_token}@github.com".insteadOf "https://github.com"Eg: git config --global url."https://johndoe:ghp_abc123@github.com".insteadOf "https://github.com"
Spring boot installation steps
- Install JDK 11
$ sudo apt install openjdk-11-jdk -y
$ java -version
- Download Gradle
$ VERSION=6.5.1
$ wget https://services.gradle.org/distributions/gradle-${VERSION}-bin.zip -P /tmp
$ sudo unzip -d /opt/gradle /tmp/gradle-${VERSION}-bin.zip
$ sudo ln -s /opt/gradle/gradle-${VERSION} /opt/gradle/latest
- Setting up environment variables for Gradle
$ sudo vi /etc/profile.d/gradle.shexport GRADLE_HOME=/opt/gradle/latest
export PATH=${GRADLE_HOME}/bin:${PATH}
- Make the script executable and execute
$ sudo chmod +x /etc/profile.d/gradle.sh
$ source /etc/profile.d/gradle.sh
$ gradle -v
- Install Spring Boot Cli
$ wget https://repo.spring.io/release/org/springframework/boot/spring-boot-cli/2.6.3/spring-boot-cli-2.6.3-bin.tar.gz
$ tar -zxvf spring-boot-cli-2.6.3-bin.tar.gz
$ sudo ln -s $PWD/spring-2.6.3/bin/spring /usr/local/bin/spring
Make first Spring Boot Application
$ vi $Projects/Sample/app.groovy@RestController
class ThisWillActuallyRun {@RequestMapping("/")
String home() {
"Hello World!"
}
}
Run the spring boot application
$ spring run app.groovy