0% found this document useful (0 votes)
93 views

Code Git

The document shows the steps taken to make changes to files in a Git repository, commit those changes to a new branch, then push the branch to the remote repository. Specifically, it creates a new branch called "update_script", adds and modifies files, commits the changes with a message, and pushes the branch to GitHub. It then checks out the master branch, removes a file, commits that change and pushes it as well.

Uploaded by

hafssa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views

Code Git

The document shows the steps taken to make changes to files in a Git repository, commit those changes to a new branch, then push the branch to the remote repository. Specifically, it creates a new branch called "update_script", adds and modifies files, commits the changes with a message, and pushes the branch to GitHub. It then checks out the master branch, removes a file, commits that change and pushes it as well.

Uploaded by

hafssa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

___code git vi alx ___

root@a42f3303532c:/alx-pre_course/0x01-git/bash# cd ..
root@a42f3303532c:/alx-pre_course/0x01-git# git branch -a
master
* update_script
remotes/origin/master
root@a42f3303532c:/alx-pre_course/0x01-git# git branch update_script
fatal: A branch named 'update_script' already exists.
root@a42f3303532c:/alx-pre_course/0x01-git# git branch -a
master
* update_script
remotes/origin/master
root@a42f3303532c:/alx-pre_course/0x01-git# git checkout update_script
M 0x01-git/bash/alx
Already on 'update_script'
root@a42f3303532c:/alx-pre_course/0x01-git# ls
bash c js README.md school
root@a42f3303532c:/alx-pre_course/0x01-git# cd bash
root@a42f3303532c:/alx-pre_course/0x01-git/bash# touch 98
root@a42f3303532c:/alx-pre_course/0x01-git/bash# ls
98 alx school
root@a42f3303532c:/alx-pre_course/0x01-git/bash# vi alx

root@a42f3303532c:/alx-pre_course/0x01-git/bash# cat alx


#!/bin/bas
echo "ALX School"
root@a42f3303532c:/alx-pre_course/0x01-git/bash# vi school
root@a42f3303532c:/alx-pre_course/0x01-git/bash# cat school
#!/bin/bash
echo "The school is open!"
root@a42f3303532c:/alx-pre_course/0x01-git/bash# git add .
root@a42f3303532c:/alx-pre_course/0x01-git/bash# git commit -m "My personal
work"[update_script 8966303] My personal work
7 files changed, 3 insertions(+), 3 deletions(-)
create mode 100644 0x01-git/bash/.alx.swo
create mode 100644 0x01-git/bash/.alx.swp
create mode 100644 0x01-git/bash/.school.swo
create mode 100644 0x01-git/bash/.school.swp
create mode 100644 0x01-git/bash/98
root@a42f3303532c:/alx-pre_course/0x01-git/bash# git push
fatal: The current branch update_script has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin update_script

root@a42f3303532c:/alx-pre_course/0x01-git/bash# git push --set-upstream origin


update_script
Enumerating objects: 15, done.
Counting objects: 100% (15/15), done.
Delta compression using up to 2 threads
Compressing objects: 100% (8/8), done.
Writing objects: 100% (10/10), 1.18 KiB | 402.00 KiB/s, done.
Total 10 (delta 3), reused 0 (delta 0)
remote: Resolving deltas: 100% (3/3), done.
remote:
remote: Create a pull request for 'update_script' on GitHub by visiting:
remote: https://github.com/hafssa77/alx-pre_course/pull/new/update_script
remote:
To https://github.com/hafssa77/alx-pre_course.git
* [new branch] update_script -> update_script
Branch 'update_script' set up to track remote branch 'update_script' from 'origin'.
root@a42f3303532c:/alx-pre_course/0x01-git/bash# git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
root@a42f3303532c:/alx-pre_course/0x01-git/bash# ls
alx school
root@a42f3303532c:/alx-pre_course/0x01-git/bash# vi alx
root@a42f3303532c:/alx-pre_course/0x01-git/bash# cd ..
root@a42f3303532c:/alx-pre_course/0x01-git# rm -r js
root@a42f3303532c:/alx-pre_course/0x01-git# ls
bash c README.md school
root@a42f3303532c:/alx-pre_course/0x01-git# git add .
root@a42f3303532c:/alx-pre_course/0x01-git# git commit -m"Hot fix"
[master 320467d] Hot fix
3 files changed, 1 insertion(+), 1 deletion(-)
delete mode 100644 0x01-git/js/main.js
rename 0x01-git/{js/index.js => school} (100%)
root@a42f3303532c:/alx-pre_course/0x01-git# git push
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 2 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 520 bytes | 520.00 KiB/s, done.
Total 5 (delta 0), reused 0 (delta 0)
To https://github.com/hafssa77/alx-pre_course.git
45e898c..320467d master -> master
root@a42f3303532c:/alx-pre_course/0x01-git#

You might also like