Posts

Showing posts from September, 2023

Useful GIT Commands

  Initiate Git git init Set configuration values git config — global user.name your name git config — global user.email your email Check current status of Git git status Add single file in Git git add filename Add all file changes to the staging area git add . Add all modified / created files in Git git add * Check the unstaged changed git diff Remove all deleted files from Git repository git ls-files –deleted -z | xargs -0 git rm Remove single file from Git repository git rm filename Commit git commit -m “Your comments” List the commit history git log Check the meta data and content changes of the commit git show commit-hash List all local branches git branch Create a new branch git branch branch-name Rename the current branch git branch -m new-branch-name Delete a branch git branch -d branch-name Switch to another branch git checkout branch-name Merge specified branch to the current branch git merge branch-name Connect to a remote repository ...