Git for Nu

Many visitors to Programming Nu have already seen this, but now that Nu development has gone public, I’ve switched from Subversion to git for version control. So far my only problem has been stupidly typing “git clean” before committing files (don’t do that!). But everything else has been great, including having gitweb to browse my repository on the web.

The official Nu repository is at code.neontology.com.

To clone it and create your own local repository, use the following command:
git clone git://code.neontology.com/Nu.git

reminders

Here are some notes on common tasks with git:

# to create a repository
% git init
% git add .
% git commit

# to set up a public repository
git clone --bare ~/Desktop/Nu Nu.git
touch Nu.git/git-daemon-export-ok
scp -r Nu.git code.neontology.com:git

# to set the description of my repository for gitweb
vi Nu.git/description

# to publish my public repository
git-daemon --base-path=/Users/tim/git

# to create a local copy of my public repository
git clone git://code.neontology.com/Nu.git

# to get a report of changes
git status

# to see differences
git diff

# to commit changes
git commit -a

# to push my commits back to my public archive
git push ssh://tim@code.neontology.com/Users/tim/git/Nu.git

# to give up on a set of changes and go back to the head
git reset --hard HEAD

# to reset a specific file back to the current head
git checkout <filename>

# another way to reset all files to the current head
git checkout .

# to reset 
# to create a new branch off of the current checkout
git branch new-branch-name

# to switch to a branch
git checkout branch-name

# to switch back to the master
git checkout master

# to push a branch up to the public archive
git push ssh://tim@code.neontology.com/Users/tim/git/Nu.git branch-name

# to fetch a branch into a local repository
git fetch git://code.neontology.com/Nu.git branch-name:branch-name

# to start using that branch
git checkout branch-name

# to merge a branch into the current branch
git merge branch-name

Comment on this post ↓

Leave a Comment (sign in with Twitter)