Difference between revisions of "Help:Contents"

From Group 4
Jump to: navigation, search
Line 70: Line 70:
 
  $ git mv [OLD_NAME] [NEW_NAME]
 
  $ git mv [OLD_NAME] [NEW_NAME]
 
===== Commits =====
 
===== Commits =====
Commits in git are pretty simple. Once you have the files staged, you can run the <code>git commit</code> command to commit the staged changes. You should run commit with the -m option which will allow you to add a commit message without the console opening up another program:
+
Commits in git are pretty simple. Once you have the files staged, you can run the <code>git commit</code> command to commit the staged changes. You should run commit with the <code>-m</code> option which will allow you to add a commit message without the console opening up another program:
 
  $ git commit -m 'commit message goes here'
 
  $ git commit -m 'commit message goes here'
Alternatively if you know that you want to include all your changes in your next commit, you can add the <code>-a</code option which will automatically commit all tracked files with changes. You will still need to stage any untracked files however.
+
Alternatively if you know that you want to include all your changes in your next commit, you can add the <code>-a</code> option which will automatically commit all tracked files with changes. You will still need to stage any untracked files however.
 
  $ git commit -am 'commit message goes here'
 
  $ git commit -am 'commit message goes here'
 
Remember that all commits are local to your machine and will always commit to your local checked out branch.
 
Remember that all commits are local to your machine and will always commit to your local checked out branch.
 
===== Viewing Commits =====
 
===== Viewing Commits =====
 
There are two main tools to look at your commit history. (Once we have a lot of branches going simultaneously this will be VERY helpful). The first is the <code>git log</code>
 
There are two main tools to look at your commit history. (Once we have a lot of branches going simultaneously this will be VERY helpful). The first is the <code>git log</code>

Revision as of 15:53, 8 April 2013

Help 1: I don't know the function header conventions!
Here's a tentative version of the function header convention, with examples in italics

/* function description this current object sends a message
	parameter: description of what it does
	curSocket: the socket we'll send the message through

	What it returns 
	Returns the number of bytes it was able to send, or an error value if unable to send

	Special notes 
	ERROR CHECK the return value
*/


Status Report Help

Go to Main page and click on your name (or click your name at the top).

Write your status report there =D, here's an example:

http://cse125.ucsd.edu/cse125/2012/cse125g1/?p=289


Or here's mine xD: http://cse125.ucsd.edu/cse125/2013/cse125g4/index.php/User:Hmonciva


Note, you'll have to create an account first =) (Go to Create account at the top)


Git Help

Configuration

When first starting to use git on a computer, you must configure it with your username and email:

$ git config --global user.name "username"
$ git config --global user.email username@example.com

Repository Init

To clone the repository, run the git clone command. This will pull down every version of every file to your local file allowing you to modify and edit to your hearts content before pushing again to the server. Clone the repository with git clone [url]. For our project, use either:

$ git clone https://github.com/haroniti/NinjaCoders125.git
$ git clone git@github.com:haroniti/NinjaCoders125.git

Local Repository Management

Staging Files

Files in a git directory can exist as either tracked or untracked. Tracked files can be modified, unmodified or staged (ready to be added to the next commit). To check the status of your repository, run:

$ git status

To add a new file to be tracked by git, run:

$ git add [file]

After modifying a file, git will not automatically add it to its next commit, to add the modifications you have made in your file to the next commit, run the git add [file] again. Lastly, if you make any changes to the file after you have staged it with add, you must run the git add command again to stage the new changes.

Ignoring Files

We are going to want to ignore certain files like the visual studio user files, object files in our build folder, etc. To ignore these, modify the .gitignore file found in the top directory. Here's an example .gitignore found in the git documentation:

# a comment - this is ignored
# no .a files
*.a
# but do track lib.a, even though you're ignoring .a files above
!lib.a
# only ignore the root TODO file, not subdir/TODO
/TODO
# ignore all files in the build/ directory
build/
# ignore doc/notes.txt, but not doc/server/arch.txt
doc/*.txt
# ignore all .txt files in the doc/ directory
doc/**/*.txt
Removing Files

To remove files from git run:

$ git rm [file]

This will unstage the file for your next commit.

Moving Files

Git does not track moved or renamed files, but it provides the git mv command which moves and re-adds the file for you:

$ git mv [OLD_NAME] [NEW_NAME]
Commits

Commits in git are pretty simple. Once you have the files staged, you can run the git commit command to commit the staged changes. You should run commit with the -m option which will allow you to add a commit message without the console opening up another program:

$ git commit -m 'commit message goes here'

Alternatively if you know that you want to include all your changes in your next commit, you can add the -a option which will automatically commit all tracked files with changes. You will still need to stage any untracked files however.

$ git commit -am 'commit message goes here'

Remember that all commits are local to your machine and will always commit to your local checked out branch.

Viewing Commits

There are two main tools to look at your commit history. (Once we have a lot of branches going simultaneously this will be VERY helpful). The first is the git log