-
Notifications
You must be signed in to change notification settings - Fork 24
Code Organisation
lamblin edited this page Apr 4, 2013
·
4 revisions
- Do not fork the repository
- Add your SSH key to GitHub (if not there already):
- Go to your user profile,
- Click on "Edit Your Profile"
- Go to "SSH Keys" in the left column
- Click on "Add SSH key"
- The title does not really matter
- The key itself is the content of your
~/.ssh/id_dsa.pub
or~/.ssh/id_rsa.pub
. If neither of these files exist, you can generate it withssh-keygen
on a Unix / Mac OS X machine. For Windows, google the instructions. - Click on "Add key".
- Clone the repo it as
git clone [email protected]:nouiz/lisa_emotiw.git
- Add to your PYTHONPATH:
.../lisa_emotiw/
- Add to your PATH:
.../lisa_emotiw/scripts/common/
AND.../lisa_emotiw/scripts/common/<username>/
lisa_emotiw/
emotiw/ (python package is named emotiw)
common/
<username>/
scripts/ (scripts will typically import from emotiw. ... )
common/
<username>/
- REPEAT ATTENTION: Do not fork the repository
- The repository hosted on GitHub will be called
origin
. It can contain different branches,origin/master
is the main one. - Your local clone can also have different branches,
master
is the main one. This localmaster
branch can be different fromorigin/master
at times. - Since every user will have her own sandbox for both scripts and Python modules, it is OK for everyone to work directly in the
master
branch, and push toorigin/master
. - If a user prefers working in a different branch, and merge regularly into the
master
, it is fine too. Just remember not to let your branch drift too much fromcentral/master
. - To get the latest version of the
central/master
branch:git pull
should be enough, if you're also working on themaster
branch. - To add changes in your local
master
branch, you have toadd
the changes first, even if the files already exists (this is different from CVS, SVN, and Mercurial, among others), then you can commit, and then push:-
git add -p
will walk you through all the changes you have made that are not yet committed (or scheduled to be committed), allowing you to accept a change or reject it (in that case, it will not be discarded, it will simply not be scheduled for commit yet), -
git commit
will create a commit with currently scheduled changes, -
git push
will push all locally created commits to the corresponding branch onorigin
, you can also specifygit push origin master
if you have different branches you do not want to synchronize yet.
-
-
git
commands are powerful, but not intuitive, and the hidden abstractions and concepts are not obvious. If you wonder how to do something withgit
, the best advice often come from googling "git how to ...".