How to add a file to a repository in AWS CodeCommit

0 votes

Hi Team,

I have one repository in AWS CodeCommit. I want to add a file to the repository with the CLI command. How can I do that?

Nov 24, 2020 in AWS by akhtar
• 38,260 points
1,662 views

1 answer to this question.

0 votes

Hi@akhtar,

You can add or update a file in a branch in an AWS CodeCommit repository and can generate a commit for the addition in the specified branch. The following put-file example adds a file named 'ExampleSolution.py' to a repository named 'MyDemoRepo'.

$ aws codecommit put-file \
    --repository-name MyDemoRepo \
    --branch-name feature \
    --file-content file://MyDirectory/ExampleSolution.py \
    --file-path /solutions/ExampleSolution.py \
    --parent-commit-id ID \
    --name "xxxxx" \
    --email "xxxxxx@example.com" \
    --commit-message "I added a third randomization routine."
answered Nov 24, 2020 by MD
• 95,460 points

Related Questions In AWS

0 votes
1 answer

How to create a new, empty repository in AWS CodeCommit?

Hi@akhtar, You can create a repository and associate it with ...READ MORE

answered Nov 23, 2020 in AWS by MD
• 95,460 points
810 views
0 votes
1 answer

How to delete a file from a branch in AWS CodeCommit?

Hi@akhtar, The following delete-file example demonstrates how to ...READ MORE

answered Nov 24, 2020 in AWS by MD
• 95,460 points
4,182 views
0 votes
1 answer

How to delete a repository in AWS CodeCommit?

Hi@akhtar, You can delete a repository in AWS CodeCommit. ...READ MORE

answered Nov 24, 2020 in AWS by MD
• 95,460 points
988 views
0 votes
1 answer

How to view information about a commit in a repository in AWS CodeCommit?

Hi@akhtar, You can get information about a commit, ...READ MORE

answered Nov 24, 2020 in AWS by MD
• 95,460 points
587 views
0 votes
1 answer
+1 vote
2 answers
0 votes
1 answer

How to add or update a trigger in a repository in AWS CodeCommit?

Hi@akhtar, The below example demonstrates how to update triggers ...READ MORE

answered Nov 25, 2020 in AWS by MD
• 95,460 points
696 views
0 votes
1 answer

How to create a branch in an AWS CodeCommit repository?

Hi@akhtar, This example creates a branch in an ...READ MORE

answered Nov 23, 2020 in AWS by MD
• 95,460 points
1,427 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP