-
Notifications
You must be signed in to change notification settings - Fork 0
git and github
Thierry Lam edited this page Mar 16, 2021
·
7 revisions
-
Remove file from index
git rm --cached indexed_file -
Cloning from remote ssh with a specific port 1234
git clone ssh://username@10.123.45.67:1234/home/username/project -
Checking out from master
git fetch; git checkout -f origin/master -
Restore an uncommitted deleted file,
deleted_file.py:git reset -- deleted_file.py git checkout -- deleted_file.py -
Stash local change while updating tree:
git stash --patchPress
ato stash the change you want anddto skip over the change you don't want stashed.git pullandgit stash popcan be followed to get the latest tree and merge the old change back. -
Disable paged output for
git branchgit config --global pager.branch false
-
Create a new branch called
maplegit branch maple -
See all branches
git branch maple * master -
Switch to the maple branch
git checkout maple -
After committing a change to the branch, push the branch to github
git push origin maple -
Delete local branch
git branch -d maple -
Delete a branch remotely
git push origin --delete maple -
Git revert
- Create a git branch, git branch revert-new-attribute
- git checkout revert-new-attribute
- git revert -m 1 abc123
- git push --set-upstream origin revert-new-attribute