Categories
Tips & Tricks

Git: Làm thế nào khi chỉnh sửa nhầm branch?

git stash git checkout <correct branch> git stash pop Stage và commit bình thường. Tham khảo: https://git-scm.com/docs/git-stash

Categories
Tips & Tricks

Git – copy committed files

Some time I have troubles when working with git patch, if some lines is mismatched, the patch could not be applied. That is time when I want to copy full files and apply to target repository. # How to do: Firstly, check out the revision that we need to get files. Next, we get list […]

Categories
Tutorials

Setup a Git server for local use

# On server side Make sure you have install ssh server, sudo apt install openssh-server Create ‘git’ user sudo adduser git sudo passwd git Create repository (remember to use git init –base on server side): su – git mkdir /home/git/sample-project.git cd sample-project.git git init –bare –shared Create users to use git sudo adduser user1 Add […]