Git - studiofu/brain GitHub Wiki

Quick Start

consider to use gitlab instead

change remote origin

git remote set-url origin https://xxxx.com/xxxxxx/

check GIT version

# git –version

git version 1.8.3.1

need to setup correct git user account in Linux or Unix

create the user by using useradd

useradd -m -s /bin/bash username
passwd username

add user to the git group ( common projects group )

useradd -a -G git [username] or
usermod [username] -aG git

to create new git repository, it is required to use “git” user account (git/abcd@xxxx) for common projects, users under git group could access the git repository under the /home/git example, create the “dummy.git” repository

mkdir dummy.git
cd dummy.git
git init –bare

to access the git repository by using git clone [username]@[git_server_ip]:/home/git/dummy.git also need to help user to set their git profile add user to the wheel group for sudo

usermod [username] -aG wheel
su [username]
sudo git config –global user.name “name”
sudo git config –global user.email “email”

Solve SSL Issues for cloning projects from github

git -c http.sslVerify=false clone https://github.com/xxxx/xxxxx

create gitc.bat file under the folder contains git.exe

@echo on
git -c http.sslVerify=false %1 %2 %3 %4 %5 %6 %7 %8 %9
https://stackoverflow.com/questions/11621768/how-can-i-make-git-accept-a-self-signed-certificate

If the repository is completely under your control, you can apply the following command to remove ssl verficiation:

git config http.sslVerify false

Basic

https://blog.wu-boy.com/2011/03/git-%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6-branch-model-%E5%88%86%E6%94%AF%E6%A8%A1%E7%B5%84%E5%9F%BA%E6%9C%AC%E4%BB%8B%E7%B4%B9/

# create new branch feature1 from master
git checkout -b feature1 master  

# merge the feature1 branch to master, --no-ff option will keep the information of the merge
git checkout master
git merge --no-ff feature1

# remove git branch
git branch -d feature1

Resources

gitkraken

https://www.gitkraken.com/download/windows64

sourcetree

https://www.sourcetreeapp.com/

fix clone git:

https://github.com/componentjs/component/issues/610

rebase vs merge

https://medium.com/datadriveninvestor/git-rebase-vs-merge-cc5199edd77c