After resetting my laptop, I just had the code backup. unfortunately
.git folder got removed while copying data. Cloning the repository again sounded bad for me due to its size and the poor intermittent network connectivity. Cloning of the repository failed multiple times. This might be a situation you might be undergoing. Here is the way I did to clone the repository to existing directory with all the remote data.
This can be done for:
Continue reading “GIT : Clone repository to the existing directory”
- Linking the local directory with data and remote git repository WITH data
- Linking the local directory with data and remote git repository WITHOUT data
You have multiple commits in a branch but all gone wrong somehow and now you want to revert back to a specific commit. This is how you do:
Situation 1: Reverting to older commit
Danger Alert: All your uncommitted changes will be lost doing this. If you have such, prefer next situation.
git reset --hard <commit_code>
git commit -m "Reverted to <commit_code>"
<commit_code> with your commit SHA Eg.
Continue reading “Git revert back to older commit”
When you are in a situation to initiate git to a directory which is already developed and you need to pull changes from the remote ignoring local changes, you will not be allowed to use:
git pull origin master
Continue reading “Git pull : Ignoring local changes”