Code Repo Commands
Table of Contents

Git

Config:

git config --global user.name "Mossaddeque Mahmood"
git config --global user.email "mahmood@cefalo.com"

Console Color Config:

git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto

Clone repo:
Create a new git repository by copying an existing one located at the URI you specify. Use "git remote add" to create an entry in git config that specifies a name for a particular URL, must have an existing git repo.

git clone  git@github.com:MahOut/mediator.git

Add repo and init:

cd cd ~/JavaProject/HealthApp/
git init #initialize git for project
git remote add origin https://github.com/Cefalo/healthapp.git # add repo
git remote -v # check

Config .gitignore:

emacs -nw .gitignore
# Ignore all dotfiles and temp files...
.*
*~
# except for .gitignore
!.gitignore

# Ignore Play! working directory #
db
eclipse
lib
log
logs
modules
precompiled
project/project
project/target
target
tmp
test-result
server.pid
*.iml
*.eml

# Java Specific
*.class

# Eclipse and Maven Specific
.classpath
.project
.settings/
target/

Basic Command:

git pull origin master #pull
git status # check status
git add . # add all file, may use git add *.java, git add src/Main.java
git reset FILE # remove added file which is added for commit 
git commit -m "xml to POJO mapping"
git push origin master # push to repo!

Show log Command:

git log

List files for a commit:

git diff-tree --no-commit-id --name-only -r 10a5d39
rest-ws/app/controllers/DrugInfoController.java
rest-ws/app/models/ResponseStatus.java
rest-ws/app/models/User.java

Github
ssh-keygen -t rsa -C "mahmood@cefalo.com"
less /home/mmahmood/.ssh/id_rsa.pub # copy public key and add to github.com ssh key section
ssh git@github.com #try and watch message for auth!

Git GUI Client
sudo apt-get install git-cola

SVN

Basic Command:

svn help
svn co http://myrepo.com/svn/global/global-yallow/branches/itinerary
svn --username mahmood co http://subversion.nyst.com/repo/trunk/trt
svn add global-blue-widget-core-carousel/src/main/webapp/images/sprite_slider_mini.png
svn add --force . # add all file recursively
svn revert target/* # remove not commited added file
svn revert filename # discard local copy change
svn update
svn status
svn ci #commit
svn commit - m "message" <filename>
svn diff -r revision1:revision2 FILENAME
svn log
svn remove -m "I deleted this file for a reason" http://svn.orp.org/....../thefile.ext
svn resolved <filename>
svn cat -r 5026 ./widget-framework/src/main/webapp/helpers/destinationsList.jsp
svn changelist proff src/main/webapp/template/widgets/storyContent/view/proffElement.jsp
svn commit -m "NG-415, change image path" --changelist proff

Create branch -

svn cp -m 'CH-137, creating branch for chumbok.com' http://subversion.chumbok.com/repo/trunk/admin-chumbok/ http://subversion.chumbok.com/repo/branches/admin-chumbok-1.1/

SVN conflict resolve:

Conflict discovered in 'global-blue-widget-core-slideshow/src/main/webapp/META-INF/escenic/publication-resources/escenic/content-type'.
Select: (p) postpone, (df) diff-full, (e) edit,
        (mc) mine-conflict, (tc) theirs-conflict,
        (s) show all options:

 (e)  edit             - change merged file in an editor
 (df) diff-full        - show all changes made to merged file
 (r)  resolved         - accept merged version of file

 (dc) display-conflict - show all conflicts (ignoring merged version)
 (mc) mine-conflict    - accept my version for all conflicts (same)
 (tc) theirs-conflict  - accept their version for all conflicts (same)

 (mf) mine-full        - accept my version of entire file (even non-conflicts)
 (tf) theirs-full      - accept their version of entire file (same)

 (p)  postpone         - mark the conflict to be resolved later
 (l)  launch           - launch external tool to resolve conflict
 (s)  show all         - show this list
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License