Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update recording-changes.asc #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 33 additions & 33 deletions book/02-git-basics/sections/recording-changes.asc
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
=== Recording Changes to the Repository
=== Merekaman Perubahan ke Repositori

You have a bona fide Git repository and a checkout or working copy of the files for that project.
You need to make some changes and commit snapshots of those changes into your repository each time the project reaches a state you want to record.
Anda memiliki sebuah repositori Git yang andal dan sebuah `checkout` atau salinan utuh dari file-file untuk project tersebut.
Anda perlu membuat beberapa perubahan dan melakukan commit pada perubahan-perubahan tersebut ke dalam repositori Anda setiap kali project mencapai keadaan yang ingin Anda catat.

Remember that each file in your working directory can be in one of two states: tracked or untracked.
Tracked files are files that were in the last snapshot; they can be unmodified, modified, or staged.
Untracked files are everything else – any files in your working directory that were not in your last snapshot and are not in your staging area.
When you first clone a repository, all of your files will be tracked and unmodified because you just checked them out and haven't edited anything.
Ingat bahwa setiap file dalam direktori kerja Anda bisa berada di salah satu dari dua bagian berikut: tracked atau untracked.
File tracked adalah file yang ada pada perubahan terakhir; status mereka bisa berupa modified, unmodified, atau staged.
File untracked adalah file lainnya - file apa pun di direktori kerja Anda yang tidak ada dalam perubahan terakhir Anda dan tidak berada di area tampilan Anda.
Saat pertama kali menduplikat sebuah repositori, semua file Anda akan mulai dilacak dan dalam status unmodified karena belum mengubah apapun.

As you edit files, Git sees them as modified, because you've changed them since your last commit.
You stage these modified files and then commit all your staged changes, and the cycle repeats.
Saat Anda mengubah file, Git melihat mereka sebagai modified, karena Anda telah mengubahnya sejak commit terakhir Anda.
Anda menampilkan file modified ini dan kemudian meng-commit semua perubahan tampilan Anda, dan siklusnya berulang.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stage di sini bukan menampilkan. stage maksudnya membuat file yang statusnya modified untuk ditambahkan di perintah git commit selanjutnya. Atau dalam kata lain perintah git add itu mengubah akan men-staged-kan file-file yang modified. Coba lihat diagram di bawah:


.The lifecycle of the status of your files.
image::images/lifecycle.png[The lifecycle of the status of your files.]
.Siklus hidup dari status file Anda.
image::images/lifecycle.png[Siklus hidup dari status file Anda.]

[[_checking_status]]
==== Checking the Status of Your Files
==== Memeriksa Status File Anda

The main tool you use to determine which files are in which state is the `git status` command.(((git commands, status)))
If you run this command directly after a clone, you should see something like this:
Alat utama yang Anda gunakan untuk menentukan file mana yang menjadi bagiannya adalah dengan command `git status`.(((git commands, status)))
Jika Anda menjalankan command ini langsung setelah menduplikat, Anda harus melihat sesuatu yang seperti ini:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clone kayanya tetap clone aja deh.


[source,console]
----
Expand All @@ -27,14 +27,14 @@ On branch master
nothing to commit, working directory clean
----

This means you have a clean working directory – in other words, there are no tracked and modified files.
Git also doesn't see any untracked files, or they would be listed here.
Finally, the command tells you which branch you're on and informs you that it has not diverged from the same branch on the server.
For now, that branch is always ``master'', which is the default; you won't worry about it here.
<<_git_branching>> will go over branches and references in detail.
Ini berarti Anda memiliki direktori kerja yang bersih - dengan kata lain, tidak ada file tracked dan file modified.
Git juga tidak melihat file untracked, atau mereka akan tercantum di sini.
Terakhir, command tersebut memberitahukan di branch mana Anda berada dan memberitahukan bahwa Anda belum menyimpang dari branch yang sama di server.
Untuk saat ini, branch tersebut akan selalu ``master'', yang merupakan branch default; Anda tidak perlu khawatir tentang hal ini.
<<_git_branching>> akan membahas branch dan referensi secara rinci.

Let's say you add a new file to your project, a simple README file.
If the file didn't exist before, and you run `git status`, you see your untracked file like so:
Misalkan Anda menambahkan file baru ke project Anda, sebuah file README yang sederhana.
Jika file tersebut tidak ada sebelumnya, dan Anda menjalankan `git status`, Anda akan melihat file untracked seperti ini:

[source,console]
----
Expand All @@ -49,23 +49,23 @@ Untracked files:
nothing added to commit but untracked files present (use "git add" to track)
----

You can see that your new README file is untracked, because it's under the ``Untracked files'' heading in your status output.
Untracked basically means that Git sees a file you didn't have in the previous snapshot (commit); Git won't start including it in your commit snapshots until you explicitly tell it to do so.
It does this so you don't accidentally begin including generated binary files or other files that you did not mean to include.
You do want to start including README, so let's start tracking the file.
Dapat Anda lihat bahwa file README baru Anda untracked, karena berada di bawah file ``Untracked files'' yang menuju output status Anda.
Untracked pada dasarnya berarti Git melihat file yang tidak Anda miliki di perubahan sebelumnya (commit); Git tidak akan memulai memasukkannya ke dalam perubahan commit Anda sampai Anda secara eksplisit memberitahukannya untuk melakukannya.
Hal ini dilakukan agar Anda tidak sengaja memasukkan file binary atau file lain yang tidak Anda maksudkan.
Anda ingin memulainya termasuk README, jadi mari kita mulai melacak file.

[[_tracking_files]]
==== Tracking New Files
==== Melacak File Baru

In order to begin tracking a new file, you use the command `git add`.(((git commands, add)))
To begin tracking the README file, you can run this:
Untuk melacak file baru, Anda menggunakan perintah `git add`. (((git commands, add)))
Untuk melacak file README, Anda dapat menjalankan ini:

[source,console]
----
$ git add README
----

If you run your status command again, you can see that your README file is now tracked and staged to be committed:
Jika Anda menjalankan command status Anda lagi, Anda dapat melihat bahwa file README Anda sekarang tracked dan staged untuk di-commitkan:

[source,console]
----
Expand All @@ -78,10 +78,10 @@ Changes to be committed:

----

You can tell that it's staged because it's under the ``Changes to be committed'' heading.
If you commit at this point, the version of the file at the time you ran `git add` is what will be in the historical snapshot.
You may recall that when you ran `git init` earlier, you then ran `git add (files)` – that was to begin tracking files in your directory.(((git commands, init)))(((git commands, add)))
The `git add` command takes a path name for either a file or a directory; if it's a directory, the command adds all the files in that directory recursively.
Anda dapat mengetahui bahwa file tersebut staged karena berada di bawah judul ``Changes to be committed''.
Jika Anda meng-commit saat ini, versi file pada saat Anda menjalankan `git add` adalah apa yang ada dalam histori perubahan.
Anda mungkin ingat bahwa ketika Anda menjalankan `git init` sebelumnya, kemudian Anda menjalankan `git add (files)`- yaitu mulai melacak file di direktori Anda.(((git commands, init)))(((git commands, add)))
Perintah `git add` mengambil nama path untuk file atau direktori; Jika itu adalah sebuah direktori, perintah tersebut menambahkan semua file dalam direktori itu secara rekursif.

==== Staging Modified Files

Expand Down