- This topic is empty.
-
AuthorPosts
-
September 9, 2014 at 12:21 pm #182368
Erik
ParticipantI have Ubuntu and installed git and now I have no idea how to find it or open it.
Update: I Alt +Ctrl+T and opened terminal and entered
sudo apt-get install git-core
then it asks for my password.. but when I try to type it in nothing happens.. I mean my keyboard not work then.September 9, 2014 at 12:34 pm #182369nixnerd
ParticipantHe he he. This is awesome. Open up your terminal. Type the following:
cd /home/erik mkdir test cd test touch test.html git init git status
This is how git works and how you should learn. What you’re doing here is changing into your user directory… which you should already be in. Also, the file path may be SLIGHTLY different in Ubuntu. If you want to know where you are at any time… just type
pwd
in the terminal. That stands for “Print working directory.”Anyway, then you’re making a directory called test. Then, you’re changing your directory to the new one you just created. Then you’re making an empty file called test.html. Then you’re initializing git so it can track all the stuff in that directory. Then, you’re having git show you the status. You should have a few items that need to be added to your head.
To track these items… type this:
git add . git commit -m "My awesome commit message."
Come back and post when you’ve done all that. Congrats… you’re now a basic git user!
September 9, 2014 at 12:40 pm #182370nixnerd
ParticipantTo clarify… the reason you can’t ‘find’ Git is because Git is a program you don’t see. That is to say, it has no graphical front-end with buttons and shit. Git was always meant to be a command-line utility. Now… you can get yourself a graphical front-end to handle git for you… so that it functions like something more akin to Dropbox. I think a few people on these forums do it that way. People I respect do it that way. But… as long as we’re spit-balling, I’ll give my opinion: That way sucks. It is my very humble opinion that you should learn Git the hard/real way.
I’m pretty sure there’s at least 4 people on these boards that would agree.
September 9, 2014 at 12:41 pm #182371Erik
Participant@NIX I Got this..
Initial commit
Untracked files:
(use “git add <file>…” to include in what will be committed)test.html
test/nothing added to commit but untracked files present (use “git add” to track)
September 9, 2014 at 12:43 pm #182373nixnerd
Participantgit add . git commit -m "My awesome commit message."
git add .
means track everything in this directory. A period in UNIX-like system usually means everything. If you only wanted to track a few files… you’d need to specify them. Once you’ve added them to your head, you need to perform your first commit. You got EXACTLY the message you were supposed to.Great job!
September 9, 2014 at 12:44 pm #182374Erik
ParticipantI keep getting this darn thing: [sudo] password for erik:
but I can’t enter anything
September 9, 2014 at 12:45 pm #182376nixnerd
ParticipantOn another note… look how fast you’re learning! You came in here a few weeks ago and didn’t know shit about shit. Now, you’ve installed Linux and you’re learning the CLI! Nice!
September 9, 2014 at 12:46 pm #182377nixnerd
ParticipantOh wow… that’s weird. You really shouldn’t need to invoke sudo to perform git commands… provided you’re in the right directory. Type
pwd
and tell me where you are in the system.September 9, 2014 at 12:47 pm #182378September 9, 2014 at 12:49 pm #182379nixnerd
ParticipantRight… but where are those directories locally? When you open up your terminal… you’re somewhere whether you know it or not. We need to find out where you are. Chances are… if you’re anywhere other than the
/home
directory… you’re going to need root privileges to do anything.September 9, 2014 at 12:49 pm #182380Erik
Participantpwd
I get:
erik@erik-Aspire-7551:~$ pwd
/home/erik
erik@erik-Aspire-7551:~$September 9, 2014 at 12:50 pm #182381nixnerd
Participantnow type
ls
and see if the directory you created is in there.September 9, 2014 at 12:52 pm #182382nixnerd
Participanterik@erik-Aspire-7551:~$
On another note… I love how Ubuntu auto-assigns the longest hostnames ever. Ha ha ha. We’ll help you change that if you want. But… you can’t be darth@deathstar. That’s my rig. Well… you could but you’d be a copycat :p
September 9, 2014 at 12:52 pm #182383Erik
Participanterik@erik-Aspire-7551:~$ ls
Desktop Downloads Music Public test
Documents examples.desktop Pictures Templates Videos
erik@erik-Aspire-7551:~$September 9, 2014 at 12:52 pm #182384Alen
Participantbut I can’t enter anything
When you get asked to enter sudo password, when you start typing, there will be no feedback (you will not see anything)… just type the password and hit enter.
-
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.