File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,6 +89,52 @@ accept modifications without having to grant write access to others.
8989## Help and discussion
9090
9191
92+ ### Help! I don't have permissions to push my local changes
93+
94+ Maybe you see an error like this one:
95+ ``` text
96+ Please make sure you have the correct access rights
97+ and the repository exists.
98+ ```
99+
100+ Or like this one:
101+ ``` text
102+ failed to push some refs to cr-workshop-exercises/forking-workflow-exercise.git
103+ ```
104+
105+ In this case you probably try to push the changes not to your fork but to the original repository
106+ and in this exercise you do not have write access to the original repository.
107+
108+ The simpler solution is to clone again but this time your fork.
109+
110+ :::{solution} Recovery
111+
112+ But if you want to keep your local changes, you can change the remote URL to point to your fork.
113+ Check where your remote points to with ` git remote --verbose ` .
114+
115+ It should look like this (replace ` your-user ` with your GitHub username):
116+ ``` console
117+ $ git remote --verbose
118+
119+ origin git@github.com:your-user/forking-workflow-exercise.git (fetch)
120+ origin git@github.com:your-user/forking-workflow-exercise.git (push)
121+ ```
122+
123+ It should ** not** look like this:
124+ ``` console
125+ $ git remote --verbose
126+
127+ origin git@github.com:cr-workshop-exercises/forking-workflow-exercise.git (fetch)
128+ origin git@github.com:cr-workshop-exercises/forking-workflow-exercise.git (push)
129+ ```
130+
131+ In this case you can adjust "origin" to point to your fork with:
132+ ``` console
133+ $ git remote set-url origin git@github.com:your-user/forking-workflow-exercise.git
134+ ```
135+ :::
136+
137+
92138### Opening a pull request towards the upstream repository
93139
94140We have learned in the previous episode that pull requests are always from
You can’t perform that action at this time.
0 commit comments