Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to push this modified file to github repository

Tags:

git

github

how can i push this modified file in github

% git status
    # On branch master
    # Changed but not updated:
    #   (use "git add <file>..." to update what will be committed)
    #   (use "git checkout -- <file>..." to discard changes in working
    #   directory)
    #    modified:   login.php
    no changes added to commit (use "git add" and/or "git commit -a")
like image 343
nh Dalim Avatar asked Feb 22 '16 17:02

nh Dalim


People also ask

How do I push an edited file to GitHub?

On GitHub.com, navigate to the main page of the repository. Above the list of files, using the Add file drop-down, click Upload files. Drag and drop the file or folder you'd like to upload to your repository onto the file tree.

How do I commit a modified file in git?

Enter git add --all at the command line prompt in your local project directory to add the files or changes to the repository. Enter git status to see the changes to be committed. Enter git commit -m '<commit_message>' at the command line to commit new files/changes to the local repository.


1 Answers

git status 

It will show you all modified file and new file in working tree

modified:   file path

Untracked files: that are not tracked by Git

For adding Untracked files

git add <file path>

after adding file you need to commit

 git commit -m "< your message>"

For committing only modified file

git commit -m "<your message>" <file_path 1> <file_path2>

Pushing code to git

git push <origin> <branch_name>

Update remote refs along with associated objects

For more details read documentation

like image 109
Prashant Srivastav Avatar answered Sep 28 '22 02:09

Prashant Srivastav