About Git…
Git is a version control system that helps developers track changes to files and collaborate with other developers.
Some Git Commands…
Here are some common Git commands and a brief description of what they do:
git init
– This initializes Git in a directory.git clone
– This makes a copy of an existing Git repository.git add
– This adds a file to the staging areagit commit
– This saves changes to the local repositorygit push
– This sends local commits to a remote repositorygit pull
– This fetches and merges changes from a remote repositorygit branch
– This lists, creates, or deletes branchesgit merge
– This merges branches togethergit status
– This shows the status of the local repositorygit log
– This shows a log of all commits in the current branchgit fetch
– This downloads new commits and branch heads from a remote repository but doesn’t merge them with the local branchesgit reset
– This discards commits, moving the branch pointer to a previous commitgit stash
– This temporarily saves changes that have not yet been committed, allowing you to switch branches without committing your changesgit tag
– This adds a tag to a specific commitgit blame
– This shows the last modification for each line in a filegit diff
– This shows the differences between two commits, branches, or filesgit config
– This sets configuration options for a Git repositorygit cherry-pick
– This applies a commit from one branch to another branchgit rebase
– This reapplies commits on top of another branch
More Git Commands…
Here are more git commands:
git apply
– This applies a patch to a set of filesgit grep
– This searches for a specific pattern in the repositorygit archive
– This creates a zip or tar archive of the repositorygit gc
– This optimizes the Git repository by cleaning up unnecessary files and compressing file datagit bisect
– This helps you find the commit that introduced a bug by performing a binary search through the commit historygit flow
– This is a collection of Git extensions that provide high-level repository operations for Vincent Driessen’s branching modelgit submodule
– This is a mechanism for including one Git repository inside anothergit am
– This applies a series of patches from email messagesgit filter-branch
– This rewrites the Git commit history, applying filters to each commitgit shortlog
– This shows a summary of commits, grouped by authorgit describe
– This shows a human-readable description of a commit, based on the nearest taggit blame --date=short
– This shows the last modification for each line in a file, including the date of the commitgit diff --stat
– This shows a summary of the changes between two commits, including the number of lines added and removedgit stash list
– This shows a list of all stashed changesgit stash apply
– This applies a stashed change to the current branchgit stash drop
– This discards a stashed changegit stash pop
– This applies a stashed change and removes it from the stash listgit stash clear
– This discards all stashed changesgit config --global
– This sets a configuration option for all of your Git repositoriesgit config --system
– This sets a configuration option for all users on a systemgit config --local
– This sets a configuration option for the current repository
Click here to find out how to enroll in the DevOps Made Easy program at BecomeATechPro.com.