Manage your dev space – Using GitHub
Welcome back. I have heard from many of my colleagues and friends that the BAS Dev Space is full, they are unable to build their project to deploy to Cloud Foundry.
There are many mechanisms to get rid out of this problem such as Bitbucket, Gitlabs, GitHub etc. Here in this blog, i will demonstrate the GitHub to manage your source code and version of the same.
- As an initial step, we need to have a GitHub account, click here to Create your GitHub account.
- Click on “Sign Up” button.
- Enter your email address, password, user name and “Y” or “N” to the last question to create an account.
- Follow the process as requested by GitHub.
- Once your registration completed, log on to your account.
- The next activity is to “Create a Repository“. Here I am using my project name “IMP_XSUAA_AUTH“. You can use any name for the repository. However, I prefer to have the same name as that of your project. Choose the properties of your repository and click on “Create repository” button. You can now see your repository is created with a branch “main“.
- Now open your BAS and open the specific project using “File -> Open Folder” and then choose your project folder.
- Click on your “Source Control” tab in your BAS. Click on the “Initialize Repository“. Initializing the repository means you are preparing your code to push to GitHub. You can choose the files from the list. The files will be shows with respect to the “.gitignore” file. This file is also customizable. You can add/remove the respective file or folder in the “.gitignore” file to ignore/add those file from/to push to GitHub.
- Now click on the “+” icon near to the “Staged Changes“.
- Go back to your GitHub repository, click on the “Code‘ button and select the http path.
- Go back to BAS, click on the three dots at the top near to “SOURCE CONTROL” ribbon at the top, choose “Remote” and then choose “Add Remote”
- System will now prompt for the repository url. Input the url that you have copied from GitHub and press Enter.
- You now requested the name of the branch you would like to push the code. Here i am giving “main” and press Enter.
- Further it will now prompt for the GitHub user name. Enter your user name and press Enter.
- Finally BAS will prompt to input the password or token. Recently GitHub has changed its security mechanism. Even though, it is prompting for Password or Token, you must enter the token.
- Open your GitHub again. Click on “Settings” from the top right corner of the web page, which is nothing but your profile.
- Scroll all the way down and click on the “Developer settings“. Click on the “Personal access token” and choose “Tokens(classic)“. Further you can click on the “Generate new token” button and choose “Generate new token(Classic).
- Provide a note, here i am giving “Token for XSUAA-Standalone”. Choose the Expiry from the dropdown. Here i am choosing the default, 30 Days. Choose all the necessary access to be granted with the token using the check box and click on “Generate token” button.
- You can now see your token is generated. Copy the same and paste it in the BAS and press Enter.
- Choose the option “Save as plaintext on the dev space for future use“.
- Click “yes” if you want a periodic “Git Fetch“
- Enter a comment and Click on the “+” button under the ribbon “Staged Changes“
- Further click on the “Commit” button.
- Now click on the three dots at the top near to “SOURCE CONTROL” ribbon at the top, choose “Branch” and then choose “Rebase Brach” and choose the “main/main” from the list. This will help you with the file conflicts where you can compare and accept the changes. Now click on the “+” button near to the File name to accept the changes.
- Now click on “Continue” and further click on “Publish Changes“. In few seconds, your code will be pushed to GitHub.
A detailed vide is enclosed. You can refer the same as well.
You are now able to push your code to GitHub and manage your workspace.