Git add # add file to the stage
[file name] add file to stage
. # add all file and sub directories to stage
-all #add all file in current directory
Git commit # commit staged files
-m add a message# " message goes here "
git remote
add # add a remote to remote list
rm # delete a remote from the remote list
git remote add #example
git remote add origin https://github.com/DanielHaro/my_project.git
git init # create a Git repository for current project
git push remote # pushes code to remote site
Master (or any branch) send code to stated branch
git pull remote # pulls data from remote and updates local data
Master(or any Branch) grabs data from stated branch
How to start a new repsoitory
1) Declare the depository on your git site in my case git hub
2) in the root directory of your project issue command ->git init
3) issue-> git add .
4)issue ->git commit -m "inital commit"
5) create remote ie ->git remote add origin https://github.com/DanielHaro/my_project.git
6) git pull origin master
7) git push origin master
That's it your done :)
No comments:
Post a Comment