Git: merge only the changes made on the branch

This article advises to instead of merging two branches, you would rebase them where git would only rebase non duplicate commits. But instead of cherry-picking, you might consider just rebasing the branch: rebase –onto release B bug where release is the release branch and bug is the bug branch. You then get something like C’—D’ … Read more

Single file as Git submodule

If you can use symlinks (e.g. you are not using Windows), then you can set up core and core.php like this: # “base” repository layout: core/ core.app # each app repository layout: base/ core/ core.php core -> base/core/ core.php -> base/core.php app/ In each app repository, the base/ directory is either a submodule that uses … Read more

strategy for git and append-mostly files

You could use the gitattributes mechanism to define a custom merge driver (like this one for instance) in order to copy automatically the relevant sections. [merge “aggregate”] name = agregate both new sections driver = aggregate.sh %O %A %B It will be a 3-way merge, which means you can easily diff %A and %B against … Read more

gitpython git authentication using user and password

What worked well for me (worked with GitHub, self hosted BitBucket, most likely will work on GitLab too). Pre-requisites Note, that despite the name, password here is your access token generated by GitHub and NOT your GitHub password. from git import Repo full_local_path = “/path/to/repo/” username = “your-username” password = “your-password” remote = f”https://{username}:{password}@github.com/some-account/some-repo.git” Clone … Read more

Will too many tags cause any issues in Git?

(Annotated) tags won’t make Git sluggish, only harder to use in that you will have an harder time to find relevant tags amongst all the intermediate ones. Worst case, it can make your web interface (like GitHub) sluggish if it has to display thousands of tags. Maybe all those tags don’t need to be pushed, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)