git 파일 추가

Programming 2021. 4. 3. 12:10 Posted by 파란크리스마스

출처

추가할 파일이 있는지 확인

$ git status
On branch master
Your branch is up to date with 'origin/master'.
 
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        dist_admin.sh
 
nothing added to commit but untracked files present (use "git add" to track)

git 파일 추가

$ git add dist_admin.sh

추가한 파일 Repository에 commit

$ git commit -m "add dist_admin.sh"
[master de5e9a98] add dist_admin.sh
 Committer: EC2 Default User <ec2-user@-------------------------->
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:
 
    git config --global --edit
 
After doing this, you may fix the identity used for this commit with:
 
    git commit --amend --reset-author
 
 1 file changed, 7 insertions(+)
 create mode 100755 dist_admin.sh

원격 저장소에 push

$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)
 
nothing to commit, working tree clean
$ git push
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 2 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 441 bytes | 441.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/-----/--------
   b9b9e27d..de5e9a98  master -> master

댓글을 달아 주세요