Giter Club home page Giter Club logo

mercurial's Introduction

mercurial

Mergurial guide (for git users)

commands

# setup user name settings `git config --global user.name "Maksim Kostromin"; git config --global user.email [email protected]`
hg config --edit
# [ui]
# username = Maksim Kostormin <[email protected]>

# init repo `git init`
hg init

# add files `git add .`
hg add .

# commit `git commit -am "message"`
hg commit -m "message"

# commit ignorring all log and tmp files
hg commit -X '**.log' -X '**.tmp'

# send update to remote repo `git push origin master`
hg push
hg push --branch default

# fetch changes from repo `git pull origin master`
hg pull

# merge dry run
hg merge -P

# merge curernt working directory with remove branch (pull must be used before merge to get changes from remote)
hg merge

# fetch (pull) changes and du update
hg pull -u

# remove files `git rm -rf some-file`
hg remove some-file

# remove files from stash `git rm -rf some-file --cached`
hg forget some-file

# status `git status`
hg status

# history `git log`
hg log

# reset to branch `git reset --hard origin/master`
hg update default --clean

# show branches `git branch -a`
hg branches

# show current branch `git branch`
hg branch
hg identify -b

# switch to another branch `git checkout feature`
hg update feature

# diff between revisions `git diff $hash1..$has2`
# hg diff -r $rev1 -r rev2
hg diff -r 127 -r 130
# hg status --rev $rev1:$rev2
hg status --rev 127:130
# when hg log shows something like:
#              $rev:$hash
# changeset:   3641:07dcw41efwe1

# revert files `git reset --hard $hash`
hg revert --all --rev 123

configurations

force mercurial do not ask password on Windows using TortoiseHg

  • install TortoiseHg, let say it into C:\opt\TortoisHg directory
  • clone repo you want to not asked password anymore (replace my-user with yours)
hg clone ssh://[email protected]/daggerok/rxjava-examples "C:\my-projects\rxjava-examples"
  • edit C:\my-projects\rxjava-examples\.hg\hgrc file
notepad C:\my-projects\rxjava-examples\.hg\hgrc
  • finally content of hgrc should be like so (replace my-password with yours)
[paths]
default = ssh://[email protected]/daggerok/rxjava-examples
[ui]
ssh = "C:\opt\TortoiseHg\lib\TortoisePlink.exe" -ssh -pw my-password
  • verify that password is not prompting anymore
hg pull --cwd C:\my-projects\rxjava-examples

Done.

mercurial's People

Contributors

daggerok avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.