7/19/2017
Make gitg settings better
gsettings set org.gnome.desktop.interface monospace-font-name "Ubuntu Mono 11"
7/16/2017
How to setup cygwin
If you need to install new packages, run the installer again!
Packages to install:
python
openssh
emacs
Because the version with cygwin package has slowness problem, to use git:
Install https://gitforwindows.org/
Add:
/cygdrive/c/Program Files/Git/mingw64/bin to PATH environment variable.
Need to change some git colors in cygwin:
git config --global color.diff.meta black
To use gitk:
Make sure gitk runs: /cygdrive/c/Program Files/Git/cmd/gitk (May need to restart the computer or something, not sure why it didn't work for the first try and all of a sudden, it worked)
Change git core.editor to "D://Programs//wscite//scite.exe"
Install meld, then run:
git config --global merge.tool meld
git config --global diff.tool meld
git config --global mergetool.meld.path "C://Program Files (x86)//Meld//Meld.exe"
git config --global --add difftool.prompt false
In .bash_profile, add
. ~/.bashrc
Download https://onedrive.live.com cygwin_home folder.
Set HOME environment variable set to C:\Users\liangzou (Must be done first. Need to logout and login again).
- Verify your Cygwin /etc/passwd does not exist
- "mkpasswd -l > /etc/passwd" (this will insert many accounts into your new /etc/passwd)
- Change the user name in the /etc/passwd to the one you want.
- kill all cygwin shells
- bring up a new cygwin shell
7/06/2017
GIT command autocomplete with alias/aliases
| # To Setup: |
| # 1) Save the .git-completion.bash file found here: |
| # https://github.com/git/git/blob/master/contrib/completion/git-completion.bash |
| # 2) Add the following lines to your .bash_profile, be sure to reload (for example: source ~/.bash_profile) for the changes to take effect: |
| # Git branch bash completion |
| if [ -f ~/.git-completion.bash ]; then |
| . ~/.git-completion.bash |
| # Add git completion to aliases |
| __git_complete g __git_main |
| __git_complete gc _git_checkout |
| __git_complete gm __git_merge |
| __git_complete gp _git_pull |
| fi |
| # Make sure you actually have those aliases defined, of course. |
| alias g="git" |
| alias gc="git checkout" |
| alias gm="git merge" |
8/29/2016
GIT commonly used commands
# How to remove unwanted file from last commit
git reset --soft HEAD~1
Then reset the unwanted files in order to leave them out from the commit:
git reset HEAD path/to/unwanted_file
Now commit again, you can even re-use the same commit message:
git commit -c ORIG_HEAD
# How to resolve conflicts
After git rebase "branch"
If you want to accept the changes from the "branch"
git checkout --ours
Or If you want to accept the changes from current branch, just run:
git checkout --theirs
Or
git rebase -s ours
How to fix this error: error: The following untracked working tree files would be overwritten by merge:
git fetch --all
git reset --hard origin/master
# Change the remote
Submodules
=========
g submodule add https://github.com/google/protobuf.git third_party/protobuf
g submodule update --init # to clone all submodules
======
By checking: https://docs.github.com/en/authentication/troubleshooting-ssh/using-ssh-over-the-https-port
which I followed the ~/.ssh/config added the port 443.
and use command like: "proxychains -q git pull", it is working now.
Here is what is working now through https, and through proxy:
❯ proxychains -q ssh -T git@github.com
The authenticity of host '[ssh.github.com]:443 ([20.205.243.160]:443)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[ssh.github.com]:443' (ED25519) to the list of known hosts.
Hi LeisureLinux! You've successfully authenticated, but GitHub does not provide shell access.
8/05/2016
Make git settings better
====================
[difftool]
prompt = false
[gitreview]
remote = origin
[gui]
fontui = -family Consolas -size 15 -weight normal -slant roman -underline 0 -overstrike 0
fontdiff = -family Consolas -size 15 -weight normal -slant roman -underline 0 -overstrike 0
[core]
editor = emacs -nw
# Remove the windows trailing space diffs
autocrlf = input
[diff]
tool = meld
[merge]
tool = meld