Why do we use git commit? The git commit command captures a snapshot of the project’s currently staged changes. Committed snapshots can be thought of as “safe” versions of a project—Git will never change them unless you explicitly ask it…
Category: git
Create and Apply git patch between two branches for selected files
While using git we can create a PR (pull request) to push changes from one git branch into another branch. This is okay if you want to push all changes from one branch into another branch and vice versa Sometimes…
Git add a directory to remote repository by origin URL
Following the following steps one can add a folder to existing Github repository. These steps can be and should be followed to add a directory to any git repository, whether it is on Github or Bitbucket or any other server.I…
How to Rename Github Repository URL Remotely and Locally
Sometimes you may need to rename your Github Repository URL for various reasons. We are not going to discuss those various reasons here of course, but in this simple tutorial I will show you how you can rename and update…
Git Cannot open .git/FETCH_HEAD: Permission denied Solution
Did you face Cannot open .git/FETCH_HEAD: Permission denied when you try to run a git pull command on your site root folder hosted on a linux server running ubuntu? If you do you are at right place for a permanent…
How to add or remove cached git credentials on linux server (Ubuntu)
This is something I need to do occasionally, that is, to add or remove cached git credentials on a Linux server. To add when you need to set up a git repository for a new project on new server for…
How to show the full URL of a Git repository using git command
I pulled a project with from GitHub a long ago. Right now I do not know the full url of the Git repository. I want to look at the full git repository but I guess it will be confusing since…
Automatic Deployment of your Git Push to Remote Server
Step by step deployment of Git Push hook to push changes to my server in a single command I have a ReactJS app setup as a git repo. Every-time I update and push to my currently working dev branch I…
How to add or remove a git submodule?
While a git sub module could be added with a single line command such as: git submodule add https://github.com/UrlToRepository.git foldernameofrepository it can be cumbersome to remove a submodule. There are various steps involved such as given in the next paragraph.…
Remove remote directory from repository after adding it to .gitignore
I had a directory named sites added to my git repository. As it contained a bootstrap file having names of each new domain in multiple sites setup hosted in the single CakePHP application it contained different domain entries and folders…