command |
Description |
| git init | initialize git repository |
| git add . | add all changed file to staging are |
| git commit -m "my message" | commit all changes to the local repository |
| git pull | pull latest changes from repository |
| git push | push all changes to remote repository |
| git config --global user.name "YOUR NAME" | setup user name |
| git config --global user.email "YOUR EMAIL ADDRESS" | setup email |
| git status | see changed file |
| git diff | see changed file in details |
| git stash save "my message" | save my changes to the stash |
| git stash pop | get the last stash and add it to the current branch |
| git stash pop stash_name | get specific stash and add it to the current branch |
| git checkout -- file_name | get file_name file from last commited checkout |
| git reset HEAD file_name | un stage file_name from staging area |
| git branch | list of my branch (current branch will be marked *branch_name) |
| git branch branch_name | create a branch with name branch_name |
| git checkout branch_name | switch to the branch_name from current branch |
| git branch -d branch_name | safe delete current branch( make sure to switch to a different branch before deleting a branch) if use -D then it will be force deletion of a branch |
| git merge branch_name | merge branch_name branch to the current branch |
| git diff branch_name1...branch_name2 | difference between two branch |
| git checkout 234234rwerwe | git checkout to specific position (last string is sha value which we can get by git log --oneline) it will put my changes to the staging area right before making any commit |
| git diff --staged | current diff in the staged area |
| git revert sha_value | revert to the position before making changes |
| git reset --soft sha_value | (make sure u do git log and copy latest sha_values in case you want to go to recent value)
make the sha_value position as current head all commits after sha_value is gone but all changes will available in staging area |
| git reset --mixed sha_value | (make sure u do git log and copy latest sha_values in case you want to go to recent value)
make the sha_value position as current head all commits after sha_value is gone but all changes will available in working directory means modified position of the file we ware working on just before git add |
| create .gitignore file at root | for ignoring file in git tracking
e.g.
|
| git rm --cached filename | stop tracking filename from now one (file will be in our working directory but wont be tracked |
| git log --grep="temp" | show log any commit that has temp keyword in it |
| git log --since = 2.days | show log anything within two days |
| git log --author="sazzad" | show log all commit done by sazzad |
| git push -u origin feature_branch_name | push my branch to remote repo |
| git checkout -b feature_branch_name origin/feature_branch_name | if you want to work on that branch, you'll need to create a local tracking branch |
| git log --pretty=format:"%h%x09%an%x09%ad%x09%s" | Minified log |
| git log --graph --oneline --decorate --all | pretty way look at log |
| git branch --merged | this will show list of branches that are included in the current branch. if this shows 3 branches it means
I wont loose any data if i delete one of the branches in the list |
| git branch -m old_branch_name new_branch_name | rename branch name |
| git merge --no--ff branch_name | marge branch with a new commit even thought fast forward merge is available. we should do this if we want
to keep track of our merges |
| git log branch_name --oneline -3 | print log of specific branch max 3 (-3 optional) |
| git merge --abort | abort merging |
| git commit | only use after fixing merge conflicts ( no commit message needed here ) |
CODE
Saturday, January 10, 2015
Useful GIT commands
Wednesday, November 19, 2014
Jsf onclick
<script type="text/javascript">
$( document ).ready(function() {
console.log("worksssssssssssssssssssssssssssssssssssssssssssss");
$("#testId\\:sendMailInitiateBtn").click();
});
</script>
<h:form id="testId">
<h:commandButton
id="sendMailInitiateBtn"
style="display: none"
action="#{createMailController.mailInit}"
/>
</h:form>
Monday, November 17, 2014
Jsf call
<h:form>
<c:set var="grpId" value="#{param['grpId']}" scope="view"/>
<h:commandButton value="Leave Group!" action="#{groupAction.leaveFromRingIDCircle(grpId)}" >
<f:param value="#{param['grpId']}" name="grpId"/>
</h:commandButton></h:form>
FacesContext fc = FacesContext.getCurrentInstance();
Map<String, String> params
= fc.getExternalContext().getRequestParameterMap();
long v_grpId = Long.valueOf(params.get("grpId"));
Monday, November 10, 2014
Jquery selector
Div for all div
Div > p all p under div
Div > p: first-child
Div strong decendent of div element
Mycls a all a under mycls div
P: even all even p element
# myid for specific id
. Clsname for all class with same cls name
Strong.myclsname all strong element that has myclsname as cls name
Sunday, November 9, 2014
Jqery additional data onclick
Add data-varName
Get inside onclick
$(this).data("varName") ;
Tuesday, October 28, 2014
MemorySafeUndeclaredThrowableStrategy
This happens when u have dependency mismatch. If u are using spring web mvc version 4 make sure spring aop is not v 3 or anything else for that matter.
You can easily see which dependency you are actually using if you have maven puffin for eclipse. There is a tab called dependency hierarchy. There in the resolved dependency you can see the actual dependency you are using and fix it accordingly.
Run tomcat as service in windows
2. Go to the tomcat bin directory
3. Type service install servicename
4. sc start servicename