Version 3 (modified by raimue (Rainer Müller), 8 years ago) (diff) |
---|
This page should contain information about how to work with git, specifically from the point of view of someone familiar with Subversion.
To start:
svn checkout https://svn.macports.org/repository/macports/trunk/dports
becomes
git clone git@github.com:macports/ports.git
When you clone you will get the entire history of the ports tree, with the latest version being checked out in the filesystem.
After you make a change, you can run git status
and get something like this.
On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: aqua/iTerm2/Portfile no changes added to commit (use "git add" and/or "git commit -a")
What this tells me, is that I've changed a Portfile, but not done anything.
After that, you can add the files that you want to add to your commit using git add aqua/iTerm2/Portfile
.
Now, git status
will look like:
On branch master Your branch is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) modified: aqua/iTerm2/Portfile
Then run git commit
and everything is set. On your machine. To push to github you then have to run git push
.
Attachments (1)
-
commit-history-with-excessive-merging.png (345.7 KB) - added by neverpanic (Clemens Lang) 8 years ago.
Attach picture that shows the result of excessive merging
Download all attachments as: .zip