How to make part of an existing Git repository a submodule
Today there’s a better way of doing this: git subtree See this answer.
Today there’s a better way of doing this: git subtree See this answer.
The reason that Git behaves like this is explained well in the answers to this question: https://softwareengineering.stackexchange.com/questions/194788/why-doesnt-git-merge-adjacent-lines-without-conflict/378258#378258 Essentially, because you need the neighboring lines to provide context to the change (you can’t just use line numbers, because something may have been added or deleted above), if the lines around it have changed you usually don’t … Read more
After a long walk on the internet, I found out that you can achieve what you want by writing directly in the git index and create the “gitlink” file type. git update-index [–add] –cacheinfo 160000 <subrepo commit hash> <submod path> Also do not forget to write the subrepo in .gitmodules (declare the external path, mostly).
Git does not know, or care. It just runs ssh. How does ssh know? It looks at your ~/.ssh/config file (edit: or gets it from ssh-agent; see below): Host github.com # IdentitiesOnly yes # see below to decide if you want this IdentityFile ~/.ssh/github_id_file Host domain.com IdentitiesOnly yes # again, see below IdentityFile ~/.ssh/another_id_file Edit: … Read more
I wrote a post-commit hook for just this purpose. The hook itself is simple; just add a file named post-commit to your .git/hooks/ directory with the following contents: git push my_remote The post-commit file should be executable. Also make sure that you add a suitable remote repository with the name my_remote for this this hook … Read more
I did some work with dulwich, a pure python implementation of Git. What I am about to say here reflects my experience with dulwich’s git implementation, not the canonical git source and so there may be differences. Git is remarkably simple – I mean, so simple it confounds! The name is really appropriate to its … Read more
I do not think it is necessary to commit this. This is kind of like a binary file itself, everytime you make a change and run a program, the file will change. last_build_id should be put into the .gitignore. Best
You have to use git add every time OR use git commit -a or git commit –all instead of plain git commit. from Git docs: -a –all Tell the command to automatically stage files that have been modified and deleted, but new files you have not told git about are not affected. add is basically … Read more
Thanks to @Chronial, I was able to cook a script to massage my git repo according to my needs: git filter-branch –prune-empty –index-filter ‘ # Delete files which are NOT needed git ls-files -z | egrep -zv “^(NAME1|NAME2|NAME3)” | xargs -0 -r git rm –cached -q # Move files to root directory git ls-files -s … Read more