Code Monkey home page Code Monkey logo

handygit's Introduction

handygit

Usefull day to day git - for when I cannot remember

Easy merging

Merge code without doing the commit with review opportunity.

  • git merge dev --no-ff --no-commit Once there is no conflicts, you can commit the merge or aborting with git merge --abort but it seems that the abort command will not remove newly created files. Files which will considered as untracked for the current branch.

Delete a remote branch

git push --delete (remote) (branch) like git push --delete origin dev

To stop tracking a file you need to remove it from the index. This can be achieved with this command.

git rm --cached <file>

To assume that a file has not modified

git update-index --assume-unchanged <file> and git update-index --no-assume-unchanged <file>

CRLF & LF

Git can handle this by auto-converting CRLF line endings into LF when you add a file to the index, and vice versa when it checks out code onto your filesystem. You can turn on this functionality with the core.autocrlf setting.

If you’re on a Windows machine, set it to true – this converts LF endings into CRLF when you check out code:

  • git config --global core.autocrlf true

If you’re on a Linux or Mac system that uses LF line endings, then you don’t want Git to automatically convert them when you check out files; however, if a file with CRLF endings accidentally gets introduced, then you may want Git to fix it. You can tell Git to convert CRLF to LF on commit but not the other way around by setting core.autocrlf to input:

  • git config --global core.autocrlf input

If you’re a Windows programmer doing a Windows-only project, then you can turn off this functionality, recording the carriage returns in the repository by setting the config value to false:

  • git config --global core.autocrlf false

handygit's People

Contributors

efleurine 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.