Change git credential storage setting in Business Application Studio
2023-12-15 05:16:46 Author: blogs.sap.com(查看原文) 阅读量:5 收藏

I recently ran into a problem where no matter what I did, BAS just didn’t want to save my git credentials. I found a lot of articles that proposed changing the built in git configuration to “store”, or change its cache timeout to be longer. But most of these settings only worked temporarily or didn’t produce any result at all.

After digging through the git config I found the following solution:

  1. Make sure autofetch is not enabled (Settings/Extensions/Git/Autofetch). You can reenable it after you have completed all the following steps.
  2. Open a terminal and execute:
    basctl --command sapbas.gitAuthenticationGetBuiltinHelperName
    

    This brings up a menu at the top of the window, allowing you to select between the two available options. Use this to select the option you prefer.

  3. Edit the gitconfig file to reinitialize the BAS git credential helper on the next authentication:
    nano ~/.gitconfig

    change the line with

    helper = /home/user/.bas-git/bas-git-helper.sh

    to

    helper = /home/user/.bas-git/bas-git-helper-init.sh

    and make sure to save your changes!

  4. Execute a git command that needs your credentials (e.g. Fetch) through either the built in git client or the terminal and enter your valid credentials.
  5. (Optional) If an error regarding an unset email appears, you can set it with
    git config --global user.email "[email protected]"

Git should now work as intended. The changed settings should also be persistent across Space restarts.


文章来源: https://blogs.sap.com/2023/12/14/change-git-credential-storage-setting-in-business-application-studio/
如有侵权请联系:admin#unsafe.sh