Search
March 2023 M T W T F S S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Categories
Hours & Info
Bookmark
Category Archives: git
Git tips
How do I discard changes in my working copy that are not in the index? git stash save –keep-index –include-untracked You don't need to include –include-untracked if you don't want to be thorough about it. or drop the stash git … Continue reading
gitsubree usage
Basic commands about subtree git subtree add –prefix=<prefix> <commit> git subtree add –prefix=<prefix> <repository> <ref> git subtree pull –prefix=<prefix> <repository> <ref> git subtree push –prefix=<prefix> <repository> <ref> git subtree merge –prefix=<prefix> <commit> git subtree split –prefix=<prefix> [OPTIONS] [<commit>] 1. Add … Continue reading
Adding an existing project to GitHub using the command line
Create a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or gitignore files. You can add these files after your project has been pushed to GitHub. Open Terminal. Change the current working … Continue reading
Posted in git, Mac, Mobile
Leave a comment
git squash
1. Add a global “squash” alias from bash git config –global alias.squash ‘!f(){ git reset –soft HEAD~${1} && git commit –edit -m”$(git log –format=%B –reverse HEAD..HEAD@{1})”; };f’ 2. ~/.gitconfig should now contain this alias: [alias] squash = “!f(){ git reset … Continue reading