9/17/19

basic Git command

run this to connect to remote repository : git clone

Created a file : start notepad example.txt

Back at the command line type the following command to get the current status of your branch and untracked files : git status

add to git :git add example.txt. After entering the above command, the file will be added as a new file also known as staging. Typing git status again shows you in green that the file is a new file that is ready to be committed.

git commit -m "First example"
Finally, now that changes have been moved from your workspace into your local repository it is ready to be pushed to the remote repository. Type the following command to push all changes to the remote repository.

git push-- check changes on git push


if you want to Modify a file and pushing to remote repository
Edit and modify one or more files in your Git.
Type git status to get see the status of all the files that have not yet been committed from the workspace to the local repository.
Type the following command to add all files. The single period indicates that you want all files to be added to the local repository. Some people may also use git add -A to add all.
git add .
git commit -m "Second update"
Finally, type git push to push the commit to the remote repository.

No comments: