- Git cherry-pick
The cherry-pick command is used to apply a commit from one branch to another branch. Let’s say you have a feature branch that you are working on that have two stories. You finished the two stories but only need to push the first story to master. You have one commit for story number one and […]
- Git log
Shows commit logs. git log is intended for creating release announcements. It groups each commit by author and displays the first line of each commit message. This is an easy way to see who’s been working on what. git log Show insertions and deletions to each file The –stat option displays the…
- Git branch
List all branches within a repository git branch //or git branch –list List all of remote branches git branch -a Create a local branch git branch {branch-name} Example: create a branch name test-100 git branch test-100 Check for the new created branch folaukaveinga@Folaus-MacBook-Pro-3 demo % git…
- Git Pull Request
A pull request is a request asking your upstream project to pull changes into their tree. The request, printed to the standard output, begins with the branch description, summarizes the changes and indicates from where they can be pulled. The upstream project is expected to have the commit named by…
- Git restore deleted commit
Sometime you commit something but then accidentally deleted it and then you would like to bring it back or continue working on it. I had this happened to me and it was frustrating to redo everything I deleted. But then I found out there is a way to recover deleted commit. Well, you want to […]
- Git reset
Get list of commits to choose from git log Git reset can change the branch pointer to point to any commit in the tree. git reset –hard <hash> $ git reset –hard 07a2a46 HEAD is now at 07a2a46 Updated index.html If you quickly check the log, you will see no history of the commits […]
- Git stash
The git stash command is used to stash away your current work and revert back to a clean working directory which matches the HEAD commit. Let’s say for example that you are in a middle of working on a feature branch and suddenly a customer issue comes up. At this point you want to […]
- Git merge
The merge command is used to bring together changes from two branches. For example, if you have a feature branch that is branched off of the master branch. When you are done with that feature branch you can use the merge command to merge it back to master. We will assume receiving-branch to be […]
- Git rebase
The rebase command is used to bring changes from another branch, usually a branch from which the current branch migrated from. It is basically putting the changes on the base and not on top. You can always rebase from master which is the source of truth. # 1 – pull latest code from master […]
- Git pull
git pull is used to fetch/download new content from a remote repository and immediately update the local repository with that content. git pull is a combination of git fetch and git merge. In the first step of operation git pull will execute a git fetch scoped to the local branch that HEAD is…
- Git push
git push is used to upload local repository commits/changes to a remote repository. This is how you transfer commits from your local repository to a remote repo. It’s the counterpart to git pull or git fetch. Pushing has the potential to overwrite changes so you have to be careful when pushing. //…
- Git commit
git commit is used to take a snapshot of the project’s currently staged changes. Commits are the core building block units of a Git project timeline. Commits are created with the git commit command to capture the state of a project at that point in time. Git Snapshots are always committed to the…
- Git clone
The git clone command is used to clone or copy a remote repository onto a destination such as your laptop or a remote server. Git supports ssh and https network protocols. Git clone ssh Git clone https
- Git set up
The git init command is used to create a git repository. The git init creates a .git subdirectory which contains the git metadata for the repository. Keep in mind that the current directory in which you run the git init command will be the repository. If your run git init again in a repository it…