Posts

Showing posts with the label GitHub

GitHub: How to pull changes from online git repository to your local

Image
  1. If you are working on some open source project which is hosted on online github repository and you want to get the files modified by other peers. The command to get changes to your local (computer) project folder, you have to execute "git pull" command. 2. Remember, you have to in the project directory of before executing any git commands.  3. The output of "git pull" looks like below.Here some one added "HelloWorld.java" to online repository and git pulled that file to my local repository.

GIT: How to add a file to local repostiory

Image
1. If you have created a new file in the project, the file will not be added to Git repository until you explicitly tell the Git. 2. When ever you create a new file, or made changes to a file, Git keeps track of changes to the file. 3. "git status" command lets you know, what are the changes added to the project. 4. The result of "git status" command looks like below. I added a file HelloWorld.txt to my HelloWorld project.  5. By using "git add" command you can add the file to Git repository. The output of "git add" as follows. 6. After executing "git add", execute "git status", you can see the message, branch is uptodate & changes to be committed, with the list of files to commit. 7. You can commit the changes to repository, by executing "git commit" command. 8. executing "git commit" won't push files to online git repository, it keeps files in your local repository. 9. If you want...