background preloader

Reference

Facebook Twitter

10 Useful git commands. Welcome to Digg Digg delivers the most interesting and talked about stories on the Internet right now.

10 Useful git commands

The Internet is full of great stories, and Digg helps you find, read, and share the very best ones. It’s simple and it’s everywhere: visit Digg on the web, find it on your iPhone, or get the best of Digg delivered to your inbox with The Daily Digg. The Team We are a small team based in New York City, and we've been working on and thinking about news applications for awhile now. With special thanks to… We also want to give a very special thanks to our friends at betaworks and the broader NYC community for lending a hand — or several — during the Digg relaunch.

Everyday GIT With 20 Commands Or So. A standalone individual developer does not exchange patches with other people, and works alone in a single repository, using the following commands.

Everyday GIT With 20 Commands Or So

Examples Use a tarball as a starting point for a new repository. $ tar zxf frotz.tar.gz $ cd frotz $ git init $ git add . <1> $ git commit -m "import of frotz source tree. " $ git tag v2.43 <2> add everything under the current directory. Make a lightweight, unannotated tag. Create a topic branch and develop. $ git checkout -b alsa-audio <1> $ edit/compile/test $ git checkout -- curses/ux_audio_oss.c <2> $ git add curses/ux_audio_alsa.c <3> $ edit/compile/test $ git diff HEAD <4> $ git commit -a -s <5> $ edit/compile/test $ git reset --soft HEAD^ <6> $ edit/compile/test $ git diff ORIG_HEAD <7> $ git commit -a -c ORIG_HEAD <8> $ git checkout master <9> $ git merge alsa-audio <10> $ git log --since='3 days ago' <11> $ git log v2.43.. curses/ <12> create a new topic branch.

Clone the upstream and work on it. Repeat as needed. Learn git one commit at a time. GIT commands. Here you will find a list with the major commands, their short descriptions and exemplary usage.

GIT commands

For a detailed description of all the GIT commands please visit git config Sets configuration values for your user name, email, gpg key, preferred diff algorithm, file formats and more. Example: git config --global user.name "My Name" git config --global user.email "user@domain.com" cat ~/.gitconfig [user] name = My Name email = user@domain.com git init Initializes a git repository – creates the initial ‘.git’ directory in a new or in an existing project.

Example: cd /home/user/my_new_git_folder/ git init git clone Makes a Git repository copy from a remote source. Also adds the original location as a remote so you can fetch from it again and push to it if you have permissions.