Skip to content

Instantly share code, notes, and snippets.

@jastisriradheshyam
Last active February 12, 2019 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jastisriradheshyam/f0b83812fca2fec82eaa45784c6970f5 to your computer and use it in GitHub Desktop.
Save jastisriradheshyam/f0b83812fca2fec82eaa45784c6970f5 to your computer and use it in GitHub Desktop.
Git commands and info

git branch
git clone repo_location
git pull origin branch_name
git push origin branch_name
git commit -S[GPG key]
git merge brach_to_merge --no-commit --no-ff
git status
git stash
git stash apply

Removes the file from the repo (after this commit has to be done) and file is not removed from current working area.
git rm --cached <filePath>

Will unstage any staged changes for the given file(s).
git reset -- <filePath>

Pull from current branch.
git pull origin $(git branch | awk '/*/ {print $2}')

create a new branch with current branch contents.
git checkout -b new_branch

remove file(s) from index
git reset PATH

add git remote
git remote add origin url_remote

verify git remote
git reote -v

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment