git ls-tree -r master --name-only
cd path/to/project-b git remote add project-a path/to/project-a git fetch project-a git merge --allow-unrelated-histories project-a/master # or whichever branch you want to merge git remote remove project-a
git push origin --delete branch_name
git log --graph --all --format=format:"(%h) %ci <%ce>%n%s"
git rm --cached giant_file
# Stage our giant file for removal, but leave it on disk
git commit --amend -CHEAD
# Amend the previous commit with your change
# Simply making a new commit won't work, as you need
# to remove the file from the unpushed history as well
git push
Contents of the top-most .gitignore
:
# ignore everything except .gitignore and folders that I care about:
*
!images*
!.gitignore
In the nested images
folder this is your .gitignore
:
# ignore everything except .gitignore
*
!.gitignore
Note, you must spell out in the .gitignore the names of the folders you don't want to be ignored in the folder where that .gitignore is located. Otherwise they are, obviously, ignored.
Your folders in the repo will, obviously, NOT be empty, as each one will have .gitignore
in it, but that part can be ignored, right. :)