Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 4

How do I change git conifg?

Solved! Go to Solution.
name: change lfs exclude

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
      with:
        lfs: true
    - name: Run a one-line script
      run: git config --unset lfs.fetchexclude

I intend to change my git config every time it has a new push, and I try the above scripts. But every time it runs, it will return me:

Run git config --unset lfs.fetchexclude
  git config --unset lfs.fetchexclude
  shell: /bin/bash -e {0}
##[error]Process completed with exit code 5.

Why? And what should I do? 

Thanks in advance for your reply!

3 Replies
Highlighted
Solution
GitHub Partner
Message 2 of 4

Re: How do I change git conifg?

Hi @yingxiaoGuo ,

 

How did you set 'lfs.fetchexclude' in your git config? Please cat the config file for confirmation( location, values..etc), please refer to my screenshot below. If i didn't set 'lfs.fetchexclude' in config file, i can reproduce the same error with you.

Checked on my side, unset command works fine, code as below:

 

name: change lfs exclude
on: [push]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
      with:
        lfs: true
    - name: cat git config
      run: |
        cd .git
        cat config
    - name: Set the lfs.fetchexclude
      run: |
        git config lfs.fetchexclude "media/excessive"
    - name: cat git config
      run: |
        cd .git
        cat config
    - name: check git config after checkout
      run: |
        git config -l
    - name: unset
      run: |
        git config --unset lfs.fetchexclude
    - name: check git config after unset
      run: |
        git config -l

unset.png

 

Thanks.

 

 

Highlighted
Copilot Lvl 2
Message 3 of 4

Re: How do I change git conifg?

Hi, Weide

 

I think I get what's going on here. I was intended to use this script to keep my remote config different from my local config, but I didn't realize that local config won't be pushed to the remote so I encountered this error. 

 

Thanks for your reply!

Highlighted
GitHub Partner
Message 4 of 4

Re: How do I change git conifg?

Hi @yingxiaoGuo ,

 

Thanks for your mark!