Quite often, we must modify a file that has already been committed to the local repository. In this case, we often end up with commit messages like: “Fixed typo.”, “Added missing parameter.”, “Removed redundant import.”
At some point, we realize that such commit clutter the code history, and it is better to avoid them. Fortunately, there are at least two options to get rid of them.
Forge allows you to work with Git forges, such as Github and Gitlab, from the comfort of Magit and the rest of Emacs.
Forge fetches issues, pull-requests and other data using the forge’s API and stores that in a local database. Additionally it fetches the pull-request references using Git. Forge implements various features that use this data but the database and pull-request refs can also be used by third-party packages.
A change log is a file which contains a curated, chronologically ordered list of notable changes for each version of a project.
Write to your GitHub activity chart. Contribute to ihabunek/github-vanity development by creating an account on GitHub.
Every application that supports Git will work with GitLab. Click here to see some of the applications & integrations we would like to highlight.
Use magit-ediff or 'e' on an unmerged item to resolve merge conflicts with ediff. Magit will set up an ediff with three buffers A, B and C. A and B are the original (conflicting) files, and C is the conflicted merge.
$ git branch new-branch-name origin/old-branch-name
$ git push origin --set-upstream new-branch-name
$ git push origin :old-branch-name
Generate SSH key:
$ ssh-keygen -t rsa -C <email1@example.com>
Generate another SSH key
:
$ ssh-keygen -t rsa -f ~/.ssh/accountB -C <email2@example.com>
Now, two public keys (id_rsa.pub, accountB.pub) should be exists in the ~/.ssh/
directory.
$ ls -l ~/.ssh # see the files of '~/.ssh/' directory
Create config file ~/.ssh/config
with the following contents:
$ nano ~/.ssh/config
Host bitbucket.org
User git
Hostname bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Host bitbucket-accountB
User git
Hostname bitbucket.org
PreferredAuthentications publickey
IdentitiesOnly yes
IdentityFile ~/.ssh/accountB
Clone from default
account.
$ git clone git@bitbucket.org:username/project.git
Clone from accountB
account.
$ git clone git@bitbucket-accountB:username/project.git
If you need to manage multiple projects within a single repository, you can use a subtree merge to handle all the references.
Typically, a subtree merge is used to contain a repository within a repository. The "subrepository" is stored in a folder of the main repository.
The best way to explain subtree merges is to show by example. We will:
Make an empty repository called test that represents our project
Merge another repository into it as a subtree called Spoon-Knife.
The test project will use that subproject as if it were part of the same repository.
Fetch updates from Spoon-Knife into our test project.
Git Large File Storage (LFS) replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server like GitHub.com or GitHub Enterprise.