VCS Note

Reading time ~1 minute

VCS Note

1. Git

Clone

Find the location where you’d like to put the repository

git clone https://github.com/chunfantasy/blog.git

Status

Check the status of the repository and make sure everything works fine

git status

Branch

In order to make the origin master branch always work properly, create a branches for each teammate in a group

git branch chun

Checkout

Shift among branches, make sure commit the current branch, otherwise the changes will be lost

git checkout chun  //use branch chun
git checkout master  //or use branch master

Add

After new files being added

git add -A

Commit

After changes happening

git commit -am "Description" //write anything instead of Description

Pull

Pull the repository from server to local

git pull //get all latest branches from server
git pull origin chun //get latest chun server
git pull origin master //get latest master server

Push

Push the repository from local to server

git push //save all latest branches to server
git pull origin chun //save latest chun to server
git pull origin master //save latest master to server

Merge

Merge from one branch to another, for example merge master to chun

git checkout chun //be sure you stay at branch chun
git merge master //merge master to chun

Reset and Stash

Reset and stash the current code if you do not need the changes

git reset
git reset --hard
git stash

Rebase

Rebase on a branch

git rebase origin/master
git rebase -i HEAD~{n}

Update submodule

git submodule update --init --recursive

Store credential

git config credential.helper store
git push -f origin {your_repo}
$ Username for 'https://github.com': chunfantasy
Password for 'https://chunfantasy@github.com':
Everything up-to-date

Set default editor

git config --global core.editor vim

2. Svn

Requirement

The following stuff is needed for the installation.

Apr

./configure --prefix=/usr/local/apr
make
sudo make install

Apr-util (must have prefix in order to be used in installation of Subversion)

./configure --prefix=/usr/local/apr-util
make
sudo make install

SQLLite

sudo apt-get install sqlite3 libsqlite3-dev

Zlib

sudo apt-get install zlib1g zlib1g-dev

Install Subversion

Download form official site and install.

./configure --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/
make
sudo make install

Create Local SVN Repository

# Checkout
svn checkout http://example.com

Submit Changes

# Update from server and then fix the conflicts if exists.
svn update

# Add all new files
svn add ./*

# Delete files
svn delete test.txt

# Commit
svn commit -m"add test"

Integrate SVN in Intellij

VCS -> Checkout from Version Control

VCS -> Browse VCS Repository

竟然无法拒绝你的打赏

微信支付

专业处理中国护照照片一次通过

专业处理中国护照照片一次通过 Continue reading

Python Notes

Published on April 01, 2021

Scrum Training Notes

Published on December 01, 2020