Transport Codes From Svn to Git

1. install git client

download git client from github

2. new git project

1
2
3
4
cd dir    
git clone http://ip:port/user/project.git
git init
git remote add origin git@ip:user/project.git

and so on

3. edit .ignore file

edit in .ignore like this

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
*.bak
*.txt
*.vm
.gitignore
#svn
.svn/
# built application files
*.apk
*.ap_

# files for the dex VM
*.dex

# Java class files
*.class

# generated files
bin/
gen/

# Local configuration file (sdk path, etc)
local.properties

# Eclipse project files
.classpath
.project

# Proguard folder generated by Eclipse
proguard/

# Intellij project files
*.iml
*.ipr
*.iws
.idea/

4. commit & push

1
2
3
git add .  
git commit -m "init"
git -u origin master

reflesh:

1
2
3
4
git rm -r --cached .  
git add .
git commit -m "fixed untracked files"
git -u origin master

目录

  1. 1. 1. install git client
  2. 2. 2. new git project
  3. 3. 3. edit .ignore file
  4. 4. 4. commit & push