This is rather strange, but I cannot perform a fairly general operation with git. Basically, I want to check the function branch, not using it, but using the SHA identifier. This SHA points between merges with the main branch.
The problem is that all I get is just the host branch without commits from the function branch. I'm currently trying to fix the regression introduced earlier in the master branch.
To be more visual, I created a small bash script to recreate the problem repository:
#!/bin/bash rm -rf ./.git git init echo "test1" > test1.txt git add test1.txt git commit -m "test1" -a git checkout -b patches master echo "test2" > test2.txt git add test2.txt git commit -m "test2" -a git checkout master echo "test3" > test3.txt git add test3.txt git commit -m "test3" -a echo "test4" > test4.txt git add test4.txt git commit -m "test4" -a echo "test5" > test5.txt git add test5.txt git commit -m "test5" -a git checkout patches git merge master
Basically, all I want to do is just βpatchesβ the validation branches with files 1-4, but not including test5.txt.
Doing: git checkout [sha_where_test4.txt_entered]
... just gives a branch with test1, test3, test4, but excluding test2.txt
More complex example:
#!/bin/bash rm -rf ./.git git init echo "test1" > test1.txt git add test1.txt git commit -m "test1" -a git checkout -b patches master echo "test2" > test2.txt git add test2.txt git commit -m "test2" -a git checkout master echo "test3" > test3.txt git add test3.txt git commit -m "test3" -a echo "test4" > test4.txt git add test4.txt git commit -m "test4" -a echo "test5" > test5.txt git add test5.txt git commit -m "test5" -a git checkout patches git merge master echo "test6" > test6.txt git add test6.txt git commit -m "test6" -a
Thanks.
source share