Skip to content

Instantly share code, notes, and snippets.

@iniyan455
Last active February 25, 2022 05:40
Show Gist options
  • Save iniyan455/7868274daec2b03d8b167610e79d8d48 to your computer and use it in GitHub Desktop.
Save iniyan455/7868274daec2b03d8b167610e79d8d48 to your computer and use it in GitHub Desktop.
Git Commands
push the code
git branch
git checkout branchname
git status
git log -n1
git add class name
git commit
git push origin HEAD:refs/for/q-common
Commit top the patch
git status
git commit --amend
git push origin HEAD:refs/changes/2327152
//Comment oneline
git log --oneline -n2
// To remove reset with class name all means .
git reset .
// Add to Commit
git add src/com/android/providers/contacts/util/VersionConfiguration.java
//Checkout branch
git checkout q-common
//git one branch to another branch
git cherry-pick -x Ic30406b7625280ddcd8f69e747deadeb1262e998
git pull
// you want to remove last commit from git
git reset --hard HEAD~1
//you want to unstage green to red means
git reset --soft HEAD~1
// change branch name
git branch -d branchname
git push origin branchname
@iniyan455
Copy link
Author

$ git mv README README.md
$ git commit -m "renamed"

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