0% found this document useful (0 votes)
2 views2 pages

Git Branch Management and Commands

Uploaded by

ratovolova
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)
2 views2 pages

Git Branch Management and Commands

Uploaded by

ratovolova
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

Lova@DESKTOP-8C2TC6S MINGW64 ~/IdeaProjects/Tp_dvd_store_Brief/dvdstore (main)

$ git branch dvdBranch

Lova@DESKTOP-8C2TC6S MINGW64 ~/IdeaProjects/Tp_dvd_store_Brief/dvdstore (main)


$ checkout dvdBranch
bash: checkout: command not found

Lova@DESKTOP-8C2TC6S MINGW64 ~/IdeaProjects/Tp_dvd_store_Brief/dvdstore (main)


$ git checkout dvdBranch
Switched to branch 'dvdBranch'
M src/main/java/com/simplon/dvdstore/controllers/client/[Link]
A src/main/java/com/simplon/dvdstore/controllers/client/[Link]
A src/main/java/com/simplon/dvdstore/exception/[Link]
A src/main/java/com/simplon/dvdstore/exception/[Link]
M src/main/java/com/simplon/dvdstore/services/client/[Link]
M src/main/java/com/simplon/dvdstore/services/client/[Link]

Lova@DESKTOP-8C2TC6S MINGW64 ~/IdeaProjects/Tp_dvd_store_Brief/dvdstore (dvdBranch)


$ git push
fatal: The current branch dvdBranch has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin dvdBranch

To have this happen automatically for branches without a tracking


upstream, see '[Link]' in 'git help config'.

Lova@DESKTOP-8C2TC6S MINGW64 ~/IdeaProjects/Tp_dvd_store_Brief/dvdstore (dvdBranch)


$ git push --set-upstream origin dvdBranch
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote:
remote: Create a pull request for 'dvdBranch' on GitHub by visiting:
remote: [Link]
remote:
To [Link]
* [new branch] dvdBranch -> dvdBranch
branch 'dvdBranch' set up to track 'origin/dvdBranch'.

Lova@DESKTOP-8C2TC6S MINGW64 ~/IdeaProjects/Tp_dvd_store_Brief/dvdstore (dvdBranch)


$ git checkout main
Switched to branch 'main'
M src/main/java/com/simplon/dvdstore/controllers/client/[Link]
A src/main/java/com/simplon/dvdstore/controllers/client/[Link]
A src/main/java/com/simplon/dvdstore/exception/[Link]
A src/main/java/com/simplon/dvdstore/exception/[Link]
M src/main/java/com/simplon/dvdstore/services/client/[Link]
M src/main/java/com/simplon/dvdstore/services/client/[Link]
Your branch is up to date with 'origin/main'.

Lova@DESKTOP-8C2TC6S MINGW64 ~/IdeaProjects/Tp_dvd_store_Brief/dvdstore (main)


$ git reset --hard HEAD~4
HEAD is now at 3b3a882 second commit

Lova@DESKTOP-8C2TC6S MINGW64 ~/IdeaProjects/Tp_dvd_store_Brief/dvdstore (main)


$ git push --force
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
To [Link]
+ 118b488...3b3a882 main -> main (forced update)

Lova@DESKTOP-8C2TC6S MINGW64 ~/IdeaProjects/Tp_dvd_store_Brief/dvdstore (main)


$ git checkout dvdBranch
Switched to branch 'dvdBranch'
Your branch is up to date with 'origin/dvdBranch'.

Lova@DESKTOP-8C2TC6S MINGW64 ~/IdeaProjects/Tp_dvd_store_Brief/dvdstore (dvdBranch)


$

You might also like