GIT remote show origin

September 15, 2014

git remote show origin displays info for your remote origin repo. I typically use this when I want to get the URL or the remote repo $ git remote show origin * remote origin Fetch URL: git@bitbucket.org:Keenlio/test-repo.git Push URL: git@bitbucket.org:Keenlio/test-repo.git HEAD branch: master Remote branches: iss1903_microsite tracked iss1907_baidu_staticmap tracked iss1910_retailer_map_pic tracked master tracked Local branch […]

GIT undo merge local and remote repo

April 24, 2014

In local or remote, wrong merge will require to revert immediately. But do not use hard reset if the merge have not been committed. Immediately once did the merge process and found it wrong, to preserve changes we made before, use ORIG_HEAD: If the wrong merge has conflict and haven’t committed, use abort with newer […]

GIT merge remote repository to local branch

April 16, 2014

First, add the remote repository $ git remote add Example: $ git remote add test-repo git@bitbucket.org:testing/testing-repository Then, pull the remote branch or master to local branch. If local branch has not been created yet, create local branch: $ git branch test_pull Checkout the branch $ git checkout test_pull Now, pull remote branch which named as […]

GIT Bash

April 14, 2014

To view original repository: $ git remote show origin To push the repo to remote master $ git push origin master To branch a repo after clone Clone repo: $ git clone <repository_url> List all branches: $ git branch -a Create new branch locally: $ git branch new_branch_name Push new branch to remote origin repository […]

GIT delete or undo last commit

March 12, 2014

Delete or undo mean it is as if you did not want that commit and when you do a git push in the future, the changes will not push to the remote branch. If you created the changes and commit to local master repo, and you still want the changes, create a new branch before […]

How to delete GIT branch both in local and remote?

December 16, 2013

To delete local branch $ git branch -d your_local_branch To delete remote branch $ git push origin :your_remote_branch or $ git push origin –delete “branchName” Deleting remote branch normally done after you or your collaborators are finished with and have merged it into master branch. However deleting local branch maybe due to testing or wrong […]