-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync current repo to another remote repo in Github Actions #177
Comments
actions/checkout@v2 is optimized to fetch a single commit by default. If you want to fetch all history for all branches, add |
@ericsciple Hi, thank you for your reply, I tried it, but still get the same error |
@ericsciple , I also post my question in https://github.jparrowsec.cnmunity/t5/GitHub-Actions/Sync-git-repo-with-Github-Actions/m-p/49037/highlight/false#M7356 , might be more clear to describe to explain the problem I met |
Might need to |
@ericsciple still, I got the same error
What I guess is the commands running in Github Actions environment are not as same as those running in my local device. Can you help me to check if the outcome should be the same as commands below that I ran in my local device
|
If you are only running on push for master, I would expect this to work: on:
push:
branches: [ master ]
job:
asdf:
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.MY_TOKEN_WITH_PUSH_ACCESS_TO_THE_REMOTE }}
fetch-depth: 0
- run: |
git remote add adobe https://github.com/kooyear/aem-sync-to.git
git push --set-upstream adobe master I dont think you want to run on the pull_request event trigger. |
I had a similar problem and had to use
|
Hi, currently I use the actions/checkout@v2 to implement the synchronization between two repos, the following is the Actions workflow file I used:
`
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Git-version
run: git version
- name: Git-remote-add
run: git remote add adobe https://github.com/kooyear/aem-sync-to.git
- name: Git-fetch-all
run: git fetch --all
- name: Git-checkout-adobe
run: git checkout -b sync-demo-master adobe/master
- name: Git-merge
run: git merge master
- name: Git-push
run: git push --set-upstream adobe master`
when this workflow is running, I got an error from
git merge master
error info is
Run git merge master fatal: refusing to merge unrelated histories ##[error]Process completed with exit code 128.
but when I run those commands in my local device, it works, the commands are
git clone https://github.com/kooyear/aem-sync-from aem-sync-from-m cd aem-sync-from-m git remote add adobe https://github.com/kooyear/aem-sync-to.git git fetch --all git checkout -b sync-demo-master adobe/master git merge master git push --set-upstream adobe master
Do you know what is the reason?
The text was updated successfully, but these errors were encountered: