Category Archives: Git

[Git] edit commit message after push

Source: stackopenflow: Changing git commit message after push (given that no one pulled from remote) git comment –amend git push –force

Posted in Git | Leave a comment

[Git] find the file’s latest edited time

Source: stackoverflow: Find when a file was deleted in Git $ git log -1 — o-core/o-service/src/main/java/path/file.java commit 0d5ab0e5d9df7d7b5906ff8db169f43b760daea0 Author: cowman cowman@mitake.com.tw Date: Mon Dec 18 17:58:26 2017 +0800 remove file.java</code>

Posted in Git | Leave a comment

[Git] remove local git tags that are not in remote

git fetch –prune origin “+refs/tags/:refs/tags/” source: stockoverflow: Remove local tags that are no longer on the remote repository

Posted in Git | Leave a comment

Add git branch name to bash prompt

edit ~/.bash_profile if [ -f $(xcode-select -p)/usr/share/git-core/git-completion.bash ]; then . $(xcode-select -p)/usr/share/git-core/git-completion.bash . $(xcode-select -p)/usr/share/git-core/git-prompt.sh fi #enables color in the terminal bash shell export CLICOLOR=1 #sets up the color scheme for list export LSCOLORS=ExFxCxDxBxegedabagacad #sets up the prompt color (currently … Continue reading

Posted in CentOS, Git, Linux, Mac, Ubuntu | Leave a comment

[Git] List of changed files with another branch

git diff –name-only branchname

Posted in Git | Leave a comment

[Git] Git command…

git stash: 暫存機制 git stash: 暫存機制,可保留目前狀態,重新取回其他版本的code git stash clear: 清除所有暫存空間 git stash drop {git status name}: 清除指定的暫存狀態,如果不加參數,則刪除最近的那一個 git stash list: 查看目前暫存列表 git stash apply {git stash name}: 取回暫存的狀態,如果不加參數,則抓取最近的版本 git stash show {git stash name}: 查看指定的暫存與parent差異的部分,如果不加參數,則顯示最近的那一個版本 git stash branch {git stash … Continue reading

Posted in Git | Leave a comment

git push 失敗

當要push的時候發生了一點錯誤…. [tdg@udnlap01 mail]$ git push -u 20141028 master Enter passphrase for key ‘/home/tdg/.ssh/id_rsa’: To git@cowman.no-ip.org:udn/udn_mail_log.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to ‘git@cowman.no-ip.org:udn/udn_mail_log.git’ To prevent you from losing history, non-fast-forward updates were rejected Merge … Continue reading

Posted in Git | Leave a comment

GitLab – Requirements

Source : Hardware requirements CPU 1 core works supports up to 100 users but the application can be a bit slower due to having all workers and background jobs running on the same core 2 cores is the recommended number … Continue reading

Posted in Git | Leave a comment

Git Server 安裝 (New)

OS: Ubuntu 14.04 Server x64 安裝Gitlab + MySQL + Nginx 系統更新 apt-get update apt-get upgrade -y apt-get dist-upgrade 安裝基本需求 # 記得要先裝vim update-alternatives –set editor /usr/bin/vim.basic sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl openssh-server redis-server … Continue reading

Posted in Git, Nginx, Ubuntu | Leave a comment

Gitlab改使用GMail SMTP

檢查 config/environments/production.rb 檔案,查看 config.action_mailer.delivery_method = :sendmail 的註解是否已增加,關閉Gitlab sendmail寄送服務 config.action_mailer.delivery_method = :sendmail [註] 使用這一篇 使用GMail SMTP寄信 (Ubuntu) 的方法應該也可以~但是目前會出現 “Mail failure – no recipient addresses” A message that you sent using the -t command line option contained no addresses that were not … Continue reading

Posted in Git, Ubuntu | Leave a comment