Tag Archives: git

git push origin feature refspec error

If you try to git push -u origin feature/branch_name and you get this error “error: src refspec feature/branch_name does not match any”, it means that your local branch are not named correctly. It should be named feature/branch_name as well, not just branch_name. Do a “git branch” to confirm yourself.

Cleaning up git history with git rebase

Git rebase is good when you want to combine some historical commits into one commit. This might be a good idea because your history contains too many unncessary test commits, or if you want to cut down the size of your git objects. On the other hand, changing history can be a dangerous thing, it … Continue reading

Deploying to wordpress from git

If you are using git and are writing plugins for wordpress, its a hassle to switch between the 2 SCM. Why not commit once and deploy to 2 places? that is what many people are trying to do. this script does exactly that: https://github.com/benbalter/Github-to-WordPress-Plugin-Directory-Deployment-Script Create a plugin first. I suggest using all lowercase, eg blarblar-blarblar-blarblar. … Continue reading

bitbucket post hook sample json

Like github, bitbucket sends a useful json post data to a url specified by you if you add a post hook in a the bitbucket repo. The post json can be useful if you want to determine the file changes of the branch that has the change. example json is

git pull – force overwrite your code with remote or local changes

Conflicts can be troublesome when you do a git pull or git merge. What if you are pretty sure that you want to use the remote version or your version of the code during a pull/merge conflict? no “git pull -f” doesn’t do it. To do it really quickly, you can To have closer control … Continue reading

insufficient permission for adding an object to repository database .git/objects

If you do a “git add” or other commands and get this error “insufficient permission for adding an object to repository database .git/objects”, it means that you must have used other user to commit or make changes to the git repo before. The best fix is to manually change the user permission of the git … Continue reading

updating software using git

If your software is version controlled using git for example, you need to version control the software update as well. For file changes, there are 3 possibilities: a) file modified b) file deleted c) new file added to handle part a) and b), we can run this code in command line by this time, “git … Continue reading

My Favourite Git Commands

I use git everyday and these are the commands that I cannot live without. HouseKeeping git status: This command must be used trillion times. Use it anytime to see where you are at. git log: gives you a quick overview of previous commit git log -p: gives you an overview of prevous commits + details … Continue reading

Git Submodule By Example

If you have been working with version control system for a while, you would know or speculated about the possibility of including references from other projects into your project. From a programmer’s point of view, this feature is useful especially when you need to include code libraries owned by someone else or common header/footer files … Continue reading

using git ignore

gitignore is helpful when you want to ignore certain files (such as the config files) while working on the files checked out from a git repository. You do not want to commit the config files because other people working on the same repository would also pull your config files which is bad. Why ignore? because … Continue reading