Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
34 views3 pages

Push File To Remote Repo. Check That The File Is in GITHUB: Mingw64

The document details the steps taken to push a file to a remote GitHub repository and create a new branch. It creates a local repository, adds a remote, commits and pushes a new file to the master branch. It then creates and checks out a new local branch called b3, pushes it to the remote repository, and deletes the local b3 branch.

Uploaded by

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

Push File To Remote Repo. Check That The File Is in GITHUB: Mingw64

The document details the steps taken to push a file to a remote GitHub repository and create a new branch. It creates a local repository, adds a remote, commits and pushes a new file to the master branch. It then creates and checks out a new local branch called b3, pushes it to the remote repository, and deletes the local b3 branch.

Uploaded by

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

Push file to remote repo.

Check that the file is in GITHUB


35845@LAPTOP-IP8SV8AD MINGW64 ~ (master)
$ cd /c/

35845@LAPTOP-IP8SV8AD MINGW64 /c (master)


$ mkdir labs3

35845@LAPTOP-IP8SV8AD MINGW64 /c (master)


$ cd labs3

35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (master)


$ git init
Initialized empty Git repository in C:/labs3/.git/

35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (master)


$ git remote add origin https://github.com/sachit148/Laps3.git

35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (master)


$ git remote -v
origin https://github.com/sachit148/Laps3.git (fetch)
origin https://github.com/sachit148/Laps3.git (push)

35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (master)


$ touch labs3.txt

35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (master)


$ dir
labs3.txt

35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (master)


$ git add .

35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (master)


$ git commit -m "Added new file"
[master (root-commit) fc774eb] Added new file
1 file changed, 3 insertions(+)
create mode 100644 labs3.txt

35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (master)


$ git log
commit fc774eb7ad43a5211b94eb86216adbc475e4798b (HEAD -> master)
Author: sachit <[email protected]>
Date: Tue Sep 15 20:29:57 2020 +0300

Added new file

35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (master)


$ git push origin master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 224 bytes | 74.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/sachit148/Laps3.git
* [new branch] master -> master
Create pull request and merge branch to master in GITHUB

35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (master)


$ git branch
* master
35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (master)
$ git branch b3

35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (master)


$ git branch
b3
* master

35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (master)


$ git checkout b3
Switched to branch 'b3'

35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (b3)


$ git branch
* b3
master

35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (b3)


$ git status
On branch b3
nothing to commit, working tree clean

35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (b3)


$ git add .

35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (b3)


$ git commit
On branch b3
nothing to commit, working tree clean

35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (b3)


$

push and create remote branch (Use same remote repo as earlier)

35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (b3)


35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (b3)
$ git push origin b3
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Writing objects: 100% (3/3), 260 bytes | 130.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/sachit148/Laps3.git
ac220eb..16a75e0 b3 -> b3

Checkout local master and delete local branch


35845@LAPTOP-IP8SV8AD MINGW64 /c/labs3 (b3)
$ git branch
* b3
master

You might also like