Moving My Project from Google Code to Github (2)

Bismillah

Continuing my progress of learning git, now I had my repository up. Accidentally, I broke it and messed it up. So, I tried to "reset" it and started everything from the very beginning since I don't understand how to fix those messy..

Now, let's learn some basic things.
0. I learn many things from http://git.or.cz/course/svn.html because... I often asked "I do this and that in subversion in this and that way. How do I do this and that in git?" just like other new Linux users who asked "I do this and that in Windows in this and that way. How do I do this and that in Linux?". (Oh my God, my sentence is quite looong... Well, I love to write anyway)
1. I started to see a bunch of screencasts, although I don't quite understand what they mean.. But, at least I wrote something here when I forget. The one that I like the most is from Bart Trojanowski.
2. Every global configuration is saved in (I use Ubuntu) $HOME/.gitconfig. Mine looks like this..
[user]
name = Prabowo Murti
email = prabowo.murti@gmail.com
[core]
pager = less -FRSX
editor = vim
[color]
ui = auto
[merge]
tool = vimdiff
just exactly as Bart said, minus the public key..
3. The most thing that I like the most from decentralized SCM (like git) is that there is an index or "staging area". I mean, you don't need to commit to the server, in this case Google Code, after you only make a single change "Hoooray.. This is a comment from me!". I can do it by "pushing" (mentioned later) after I'm back from Hawaii. Staging area is an area that stores "what will be commited" or informations alike. That's why it's called "stage".
4. Centralized SCM vs decentralized scm. I don't get it when I talk about this "versus" since I don't use subversion a lot (I suck in Subversion, remember?). But, from what I got from the screencast, there are many server in DSCM so we can "clone" (mentioned later) anyone's server instead of using only ONE server. Imagine when everybody commits to the same project at the same time in subversion..

Okay.. Now, the details.
0. I've created the repository on github.com (Yes, the free package one). Initialize everything based on the tutorial I posted earlier, and everything seems to run flawlessly.
1. Because I always failed when importing my project from Google Code, I try the hard way: manual.
sangprabo@sheryl:~/mainan/syahfi-svn$ svn checkout https://syahfi.googlecode.com/svn/trunk/ trunk --username prabowo.murti
Authentication realm: Google Code Subversion Repository
Password for 'prabowo.murti':
Checked out revision 16.
sangprabo@sheryl:~/mainan/syahfi-svn$ ls
branches tags trunk wiki
sangprabo@sheryl:~/mainan/syahfi-svn$ cd trunk/
sangprabo@sheryl:~/mainan/syahfi-svn/trunk$ ls
Browse.java EditCard.java Learn.java Statistic.java Syahfi.java
Card.java ImportCard.java Setting.java Store.java

Now, I get the files. Please correct me if you know the easier way than mine (I suck in Subversion, remember?). Thanks!

2. Copy all the files to other directory and labeled it different (~/mainan/syahfi).
sangprabo@sheryl:~/mainan/syahfi$ cp ../syahfi-svn/trunk/*.java .
sangprabo@sheryl:~/mainan/syahfi$ ls
Browse.java EditCard.java Learn.java Setting.java Store.java TESTFILE
Card.java ImportCard.java README Statistic.java Syahfi.java

3. Tell git you change the dir..
sangprabo@sheryl:~/mainan/syahfi$ git add *.java
sangprabo@sheryl:~/mainan/syahfi$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD ..." to unstage)
#
# new file: Browse.java
# new file: Card.java
# new file: EditCard.java
# new file: ImportCard.java
# new file: Learn.java
# new file: Setting.java
# new file: Statistic.java
# new file: Store.java
# new file: Syahfi.java
#

4. Commit (just like the subversion does..)
sangprabo@sheryl:~/mainan/syahfi$ git commit -a
Created commit 72dbc91: Add all files..
9 files changed, 2241 insertions(+), 0 deletions(-)
create mode 100644 Browse.java
create mode 100644 Card.java
create mode 100644 EditCard.java
create mode 100644 ImportCard.java
create mode 100644 Learn.java
create mode 100644 Setting.java
create mode 100644 Statistic.java
create mode 100644 Store.java
create mode 100644 Syahfi.java


5. Now, take a look on your project in github.com/[projectName]/tree/master (yes, the free package one..). What? Nothing happens?? Of course..Because we don't "push" it yet.
sangprabo@sheryl:~/mainan/syahfi$ git push origin master
Counting objects: 12, done.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 20.21 KiB, done.
Total 11 (delta 0), reused 0 (delta 0)
To git@github.com:sangprabo/syahfi.git
8a0fca1..72dbc91 master -> master

and then go to the project's tree
What is "push"? From what I can concluded, it's "telling the remote to update its data with our local repository..". So when I "push", it's like "svn commit" to a particular server. Cmiiw... (I suck in Subversion, remember?)

That's it.

1 komentar:

  1. Thanks for the honorable mention!

    Have lots of git fun.

    -Bart.

    BalasHapus

speak now or forever hold your peace

About Me