GIT

|
Divnesh BLOG



git clone <>

git checkout

git add .

git commit -m ""

git checkout master

git merge develop

git push

git checkout develop


git remote add origin  <REMOTE_URL> 

git remote -v

git push origin main

mvn dependency:purge-local-repository


mvn dependency:tree -  to find hirerachy of dependency


git remote add <name> gitssh url

git remote - to check remote branch added

git remote -v -  to check remote branch with sshurl

git pull -r <name> <branch name>

git status

git rebase --continue

git push -f origin

git config

cat ~/.gitconfig To check the git configuration

git config

Rm -rf <project> Delete repo

git log --oneline --decorate --all --graph

git pull -r When there is a commit in repo pull with rebase

git stash

git stash drop

git stash apply

git stash list

git stash apply stash@{n} / n

git checkout HEAD^ /path/to/file

git commit --amend

git push -f

git pull -r origin <branch> To pull the code from other branch

git rebase --edit-todo

git reflog To show all the commits with hashcode of all amends

git reset --soft <hashcode> To revert to that commit and then stash the changes

git remote add origin git@github.com:User/UserRepo.git To set the origin 

git remote set-url origin git@github.com:User/UserRepo.git To reset the origin to new remote url

git show some_commit_sha1 -- some_file.c | git apply -R Revert particular file

git rebase -i HEAD~x To remove particular commit

drop <commit hash>

git  push --force-with-lease Push after removing patricular commit

 

Featured Post

HTML cheetsheet

List: Link tgs Dropdown

Popular Post

(C) Copyright 2018, All rights resrved InShortView. Template by colorlib