Sometimes, you want to change some old commits or you want repo to restore to that commit. You need to use “git reset” command in those cases. Options of “git reset” are “—hard, –mixed (default), –soft”. Let’s create three files and commit it once by one. So we will have below last three commits in our […]
Merge conflicts occur when competing changes are made to the same line of a file, or when one person edits a file and another person deletes the same file. A merge conflict is an event that occurs when Git is unable to automatically resolve differences in code between two commits. When all the changes in […]
Let’s say we have three branches feature1, 2 and master branch. Where master branch is our final branch. Git learns each branch as same. The each branch can’t see other branch commits until a merge happened. There are two ways for merging branch, once is fast-forward merge and other one is 3-way merge. Fast Forward […]
What is branch?Branch is just text reference to the commit.- Default branch is master.- Multiple branches can exists in the same repository.- Pointers for all branches are located in .git/refs/heads folder.- Current branch track new commits.- Branch pointer moves automatically after every new commit.- hange branch git checkout <branch>Now we will create a branch and below is the command to […]
Let’s consider, we have two copies of a git repo on two servers. One is on server “managed1” and “managed2”.The first issue occurred when you have made changes on managed1 and pushed it to remote. But on managed2 you haven’t pull the latest repo and committed the changes. It will give you error. On managed1: […]
Git is a distributed version control system (DVCS) that is widely used for tracking changes in source code during software development. Git was initially designed and developed by Linus Torvalds for Linux kernel development. It is a free software distributed under the terms of the GNU General Public License version 2. Git is distributed version-control […]
Recent Blog