Git: Difference between revisions

From The Incoherency.Net Wiki
Jump to navigation Jump to search
Denis (talk | contribs)
No edit summary
Denis (talk | contribs)
No edit summary
Line 34: Line 34:


  $ git checkout -b experimental origin/experimental
  $ git checkout -b experimental origin/experimental
== Default Push Action ==
git config --global push.default matching


== Useful Links ==
== Useful Links ==

Revision as of 22:37, 2 July 2009

Creating a new Project

$ tar xzf project.tar.gz
$ cd project
$ git init

Git will reply

Initialized empty Git repository in .git/

You've now initialized the working directory--you may notice a new directory created, named ".git".

Next, tell git to take a snapshot of the contents of all files under the current directory (note the .), with git-add:

$ git add .

This snapshot is now stored in a temporary staging area which git calls the "index". You can permanently store the contents of the index in the repository with git-commit:

$ git commit

Importing from CVS

$ git cvsimport -v -d <cvsroot> -C <destination> <module>

Push local branch to Repo

$ git push origin branchname

List all remote branches

$ git branch -a

Checkout remote branch into local branch

$ git checkout -b experimental origin/experimental

Default Push Action

git config --global push.default matching

Useful Links