Skip to content

Instantly share code, notes, and snippets.

@cmaggiulli
Last active September 3, 2022 07:57
Show Gist options
  • Select an option

  • Save cmaggiulli/763754bfc7734c3700cda2339ac24b32 to your computer and use it in GitHub Desktop.

Select an option

Save cmaggiulli/763754bfc7734c3700cda2339ac24b32 to your computer and use it in GitHub Desktop.
Move file across branches, clobber destination, without merge
#!/bin/bash
source_branch=DA-1819
destination_branch=release-3.2.0
relative_file_path=structures/serializers/node.py
git clone https://github.com/cmaggiulli/app.git -b $source_branch $source_branch
cd $source_branch
git checkout $destination_branch
git checkout --patch $source_branch $relative_file_path
git add $relative_file_path
git commit -m "patching file"
git push -o merge_request.create
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment