-
Rebase is used in merging two or more commits into one. Per experience, you can only rebase to an older commit. Say, in these commits 1~$ git log -2 --pretty=oneline 2a0dd6b55000399c5f8b5f0f55286e167725e51c2 (HEAD -> v0.2.x_wip, origin/v0.2.x_wip) docktie_cli getx: Tested working implementation for #17. …
Read More -
Sometimes, for automation purposes, you would like to get the latest commit in a working copy. Below is how you do it. 1~$ git rev-parse --short HEAD Remove the --short HEAD if you need the longer version.
Read More -
It's quite annoying when you committed large files to git specially if it's something that's something confidential. We'll relatively easy to do that. Just use the 'filter-branch' command in git as follows: 1git filter-branch --force --index-filter \ 2> 'git rm --cached --ignore-unmatch …
Read More -
From the example in https://docs.github.com/en/rest/reference/pulls#create-a-pull-request, it seems quite easy: 1curl \ 2-X POST \ 3-H "Accept: application/vnd.github.v3+json" \ 4https://api.github.com/repos/octocat/hello-world/pulls \ 5-d …
Read More -
1~$ git fetch 2fatal: unable to access 'https://github.com/icasimpan/example.git/': SSL connect error Fixed by: 1yum update -y nss curl libcurl
Read More -
Sometimes, you need to use specific keys. To do it, use ssh config, something like below in ~/.ssh/config 1host github.com 2HostName github.com 3IdentityFile ~/.ssh/id_rsa_github 4User git See details in https://superuser.com/questions/232373/how-to-tell-git-which-private-key-to-use
Read More -
In some situations, you only need the latest commit log, saving space in the process. You have to do it as follows: 1git clone --depth=1 REPO
Read More -
Submodules is quite a pain to manage. To make it easy, just use this command: 1git clone --recursive <repo_full_path> Failure to use --recursive would mean using a lot of commands later. See detailed git submodules commands in https://www.vogella.com/tutorials/GitSubmodules/article.html
Read More -
Get the commit-hash (e.g. of last commit) 1git log -1 Show the files changed only in commit 1git show --stat <commit-hash> See details in https://stackoverflow.com/questions/424071/how-to-list-all-the-files-in-a-commit
Read More -
If you need to merge a remote repo's (e.g. acquia) branch to your local branch: 1git pull acquia master
Read More