git init
git clone
git config user.name "Akash Das" git config user.email "[email protected]" git config --list
git status
git add --all
or
git add -A
git add . // stages new files and modifications(on the current directory and its subdirectories)
git add * // stages new files and modifications, without deletions (on the current directory and its subdirectories)
git add *.js // stages all .js or with any extension new files and modifications
git add -u // stages modifications and deletions, without new files
git reset // use 'git reset' to undo staged files to unstage
git commit -m "write something about to commit"
git reset HEAD~ // undo local repogitory to working directory
git reset --hard // Suppose, you have deleted any files from working directory and staged that deleted files and you want to back them in working directory then run this command
git rm // Remove the file and staged that deleted file
git rm -f
git rm -r
git branch
git branch
git checkout
git checkout -b
git merge
git merge -m "message"
git push origin // git push command is used to upload local repository content to a remote repository
git fetch // git fetch really only downloads new data from a remote repository - but it doesn't integrate any of this new data into your working files. or git fetch --all // --all flag fetch all remotes.
git pull origin master/main // update your current HEAD branch with the latest changes from the remote server. This means that pull not only downloads new data; it also directly integrates it into your current working copy files.
*** Git Pull = Git Fetch + Git Merge
