My Tech Notes
Showing posts with label
git
.
Show all posts
Showing posts with label
git
.
Show all posts
Migrate git repository to GitLab using the command line
›
Create a new EMPTY repository in GitLab. (Note: You MUST uncheck "Initialize repository with README" ) Clone from the sourc...
Git: disable autocrlf end-of-line conversion
›
When adding files to git, git add --all , you may get the error: fatal: CRLF would be replaced by LF in ... ... You can turn off the auto...
Git end-of-line conversion settings
›
Enable end-of-line conversion git config --global core.autocrlf input Make sure your IDE (Text) Editors are unix/dos EOL aware. Glob...
Configure Git-Bash for Windows Terminal
›
Open Settings tab with Ctrl+, , the click Gear icon to Open settings.json file Add/Edit Git Bash profile: { "guid": ...
git not working after Mac OS upgrade
›
The problem: after upgrade to Catalina, got the error below when executing git command: $ git push xcrun: error: invalid active developer p...
git: move tag
›
git tag -f -a <tagname> git push -f --tags
SSH access to Github from multiple accounts
›
Generate SSH Keys: ssh-keygen -t rsa -b 4096 -C "email@personal.com" -f ~/.ssh/id_rsa_personal ssh-keygen -t rsa -b 4096 -C ...
Github: Use Access Token to authenticate over HTTPS
›
Login to Github If you have not enabled Two-factor authentication , you need to enable it: Go to "Settings" -> "Se...
Github: fork a repository and sync the fork
›
Fork a repository Clone the repository: git clone https://github.com/ORIGINAL_OWNER/ORIGINAL_REPO.git Add the original repository as ups...
git: ignore .DS_Store files globally
›
git config --global core.excludesfile ~/.gitignore echo ".DS_Store" >> ~/.gitignore
git: revert back to a specific version
›
Command 1: Revert back to previous version(Note: substitute to your commit hash.): git reset --hard 76f134a2692c9472af3227d2f9fdb50548de6c0...
git: list all the files for a particular commit
›
Use one of the commands below: git show --name-only 76f134a2692c9472af3227d2f9fdb50548de6c0c git diff-tree --no-commit-id --name-only -r ...
Mac OS X: install git without xcode
›
git is included in xcode. but if you just want git, you do not have to install the xcode. You can download and install git for mac . Downlo...
Git: Remove a file from the repository without deleting it from the local filesystem
›
git rm --cached MyClass.java See also Stackoverflow
Remove file completely from git repository
›
To remove file dir/secret.txt : git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch dir/secret.txt' --prune-...
git: discard local changes
›
To discard all local uncommitted changes: git reset --hard which is equivalent to: git reset --hard HEAD To discard the latest local comm...
GIT: show the commits in chronological order
›
git log --tags --date-order --pretty=format:'%ci %h %an %d %s' git-log git log man page
GIT: list tags in chronological order
›
git log --date-order --graph --simplify-by-decoration --pretty=format:'%ai %h %d' git-log git log man page
git: count total number of lines
›
Method 1: git ls-files | xargs wc -l or count only .java files: git ls-files | grep '.java$' | xargs wc -l Method 2: gi...
Mac OS X Mountain Lion: Install git
›
Install xcode from App Store Start Xcode , select "Xcode" -> "Preferences..." from the menu bar Activate "...
›
Home
View web version